Новый человек в докере, создаю свою универсальную среду для проектов. Апач+убунта - проблем не было, но с альпийским линуксом есть некоторые сложности.
Вот мой докер-файл:
FROM php:5.6-fpm-alpine
RUN apk update && apk add autoconf file g++ gcc binutils isl libatomic libc-dev musl-dev make re2c libstdc++ libgcc libcurl binutils-libs mpc1 mpfr3 gmp libgomp coreutils freetype-dev libjpeg-turbo-dev libltdl libmcrypt-dev libpng-dev openssl-dev libxml2-dev expat-dev
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini
RUN docker-php-ext-configure mcrypt \
&& docker-php-ext-install mcrypt \
&& docker-php-ext-enable mcrypt
RUN docker-php-ext-configure mysqli \
&& docker-php-ext-install mysqli \
&& docker-php-ext-enable mysqli
RUN apk add curl-dev
RUN docker-php-ext-configure curl \
&& docker-php-ext-install curl \
&& docker-php-ext-enable curl
RUN pecl install mailparse-2.1.6 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name mailparse.so)" > /usr/local/etc/php/conf.d/mailparse.ini \
&& docker-php-ext-enable mailparse
RUN docker-php-source delete
RUN apk add nano nginx
ENV TERM=xterm
RUN apk add bash
В контейнере nginx сам пока не стартует (наверное, нужен entrypoint), но дело в том, что он не стартует и вручную:
bash-4.3# nginx
nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
bash-4.3# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
bash-4.3# /etc/init.d/nginx start
* WARNING: nginx is already starting
bash-4.3# ps aux
PID USER TIME COMMAND
1 root 0:00 php-fpm: master process (/usr/local/etc/php-fpm.conf)
7 www-data 0:00 php-fpm: pool www
8 www-data 0:00 php-fpm: pool www
9 root 0:00 bash
102 root 0:00 ps aux
bash-4.3#
bash-4.3# ls /run
bash-4.3#
логи
2016/12/23 23:44:34 [emerg] 63#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:45:52 [emerg] 71#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:49:30 [emerg] 82#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:49:41 [emerg] 83#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:49:55 [emerg] 84#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:53:58 [emerg] 86#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
2016/12/23 23:54:00 [emerg] 87#0: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)