Helle everyone.
I've a little issue with Docker. I try to create a basic docker-composer.yml for my projects with Laravel.
So here is my docker-compose.yml which is in the root directory of my project :
version: '2'
services:
php:
container_name: php
build:
context: ./
dockerfile: docker/app.docker
volumes:
- ./:/var/www
links:
- mysql
- redis
- cache
environment:
- "DB_PORT=3306"
- "DB_HOST=mysql"
- "REDIS_PORT=6379"
- "REDIS_HOST=redis"
nginx:
container_name: nginx
build:
context: ./
dockerfile: docker/web.docker
volumes:
- ./:/var/www
ports:
- "80:80"
- "443:443"
- "9000:9000"
links:
- php
mysql:
container_name: mysql
image: mysql:5.7.18
environment:
- "MYSQL_ROOT_PASSWORD=secret"
- "MYSQL_DATABASE=docker"
ports:
- "3306:3306"
redis:
container_name: redis
image: redis:3.0
ports:
- "6379:6379"
cache:
container_name: memcached
image: memcached:alpine
ports:
- "11211:11211"
So as you can see, I try to install several containers : PHP, Nginx, MySql, Redis and Memcached.
Now here is my docker file for my PHP container :
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
It's the code I've found on the docker website.
But the docker-compose up command start well and crash while executing the configuration file.
It returns
Step 1/2 : FROM php:7.0-fpm
---> e04605d12f83
Step 2/2 : RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
---> Running in fd19753fb969
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd'
returned a non-zero code: 139
Does anybody already has this kind of error ? I've tried with PHP 7.1 fpm, same error is triggered.
I don't see what is wrong.
Do not hesitate to ask me some other parts of code.
Thanks for your help.