docker-php icon indicating copy to clipboard operation
docker-php copied to clipboard

php-fpm.conf is missing

Open sacesare opened this issue 6 years ago • 7 comments

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

sacesare avatar Jun 15 '18 19:06 sacesare

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?

petk avatar Jun 15 '18 21:06 petk

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

sacesare avatar Jun 16 '18 14:06 sacesare

  • Docker version 18.05.0-ce, build f150324
  • Ubuntu 18.04 with 4.15.0-23-generic kernel

petk avatar Jun 16 '18 20:06 petk

@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

insekticid avatar Jun 17 '18 09:06 insekticid

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 avatar Jun 17 '18 20:06 sacesare

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 avatar Jun 19 '18 19:06 sacesare

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

adaliszk avatar Jul 27 '18 10:07 adaliszk