phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

php-fpm.conf is missing #19

Open sacesare opened 6 years ago

sacesare commented 6 years ago

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

petk commented 6 years ago

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?

sacesare commented 6 years ago

Version of docker and host? It's working for me on docker 17.09.0-ce too, maybe /var/lib/docker corrupted?

petk commented 6 years ago
insekticid commented 6 years ago

@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

sacesare commented 6 years ago

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.

sacesare commented 6 years ago

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.

adaliszk commented 5 years ago

@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).