docker-php
docker-php copied to clipboard
php-fpm.conf is missing
After install of any extension like "php7.1-pdo_pgsql", docker delete /etc/php/7.1/*.conf files, so fpm not work anymore.
Sample Dockerfile: FROM phpearth/php:7.1-nginx RUN apk add --no-cache php7.1-pdo_pgsql
Docker version: 18.03.1.ce-1.el7.centos Linux: centos 7
Hello, thanks for reporting this issue.
I've just did the following and it seems to work ok:
mkdir test-project && cd test-project
echo "FROM phpearth/php:7.1-nginx\nRUN apk add --no-cache php7.1-pdo_pgsql" > Dockerfile
docker build -t test/project -f Dockerfile .
docker run -it --rm -p 8080:80 --name my_project_container test/project
# in a new terminal
docker exec -it my_project_container sh
ls /etc/php/7.1
and everything is there. Yes?
Version of docker and host? It's working for me on docker 17.09.0-ce too, maybe /var/lib/docker corrupted?
- Docker version 18.05.0-ce, build f150324
- Ubuntu 18.04 with 4.15.0-23-generic kernel
@sacesare I think that you have mounted directory /etc/php/7.1/ from your filesystem. double check this! I made that same mistake some time before too
Thank you,guys, it seems docker storage issue anyway. I've to check it on another docker version and machine. @insekticid I've tested my container same way as Peter suggested with same outcome, so it's not "-v" option. Anyway, if I install something else , not php7.1-* php earth package, everything is ok.
Interesting observation, if I run "apk add --no-cache php7.1-*" inside of running base image: docker run --rm -it --entrypoint=sh phpearth/php:7.1-nginx everything is ok- /etc/php/7.1 stays intact. But "docker build" with same "apk add..." command simple replace base image's /etc/php/7.1 directory, destroying base content.
@sacesare Weird, I'm using the apk repo on top of alpine and I haven't seen this issue, if I install something the files stay the same default, I can copy them out modify and add them again (switching FPM socket mode for example).