Seems that all php:*-fpm images are broken.
No matter if PHP-7 or PHP-5.6, the results are the same.
Using own Dockerfile based on the official Dockerfile and building own image runs flawless.
Here's the error:
pb@xxx:~>docker rmi php:7-fpm
Untagged: php:7-fpm
Deleted: sha256:e6e0357f88cd6f389a2ed36c677110ed425384af7969683ec411f6d7e12b7852
Deleted: sha256:fd4903ad8e110ec65e5e9ee0ca9049ed8bc3398c055e6b35584595de1a2a0a72
Deleted: sha256:f249bef4492b05d11ee428add05bc396594d2303cd227cfca9fdce6e6646d192
Deleted: sha256:9caddca25062dd9ba41338c4846246d9286f67aae234362a6dbb8c713c3aa1d4
Deleted: sha256:cbf25f63ec36247c49d2e8c313aff8dcb8bce0b93fe3a9edab5056fb28ac5983
Deleted: sha256:f00acee5d714be3a49f5b4ffb6b07147029cfaa21da6c5e01f77dfbdebf29ac9
Deleted: sha256:caaab4576e5d63a21cd4323167195e2819fa2ebe90d1db7af986150032d69049
Deleted: sha256:9bd360b6fa984631b711bfb971dc35bafe972aeec81a9b44333fdb1720b8ac37
Deleted: sha256:57f7ec48a860d38973797d7cc453d2d594df5aa65c8f00d3976d7a32ebae6329
Deleted: sha256:552e557eeb8dc8e7165970f42481993b88ee11bd9f571519bbd09de4a061b800
Deleted: sha256:9fc126886a502846b0fbdf37c7670b030576e32c4cde2ee487a7732bb5ba9f5f
Deleted: sha256:38603e104f7080ef3009e35ff48e9864e97447045e2aeed6a6a3b163dd1cdaca
Deleted: sha256:53031580b529422618f6e2726447d6c5266f4fdb6be09d36f071a78ed14d2c46
Deleted: sha256:f10b8ace27f6486c82379d61d03793d80c1eb64e594033e61032f0ad0a8cdc8d
Deleted: sha256:14886aee6c8f8a44bf2953a58f2cfb497e098ef549d6db1fbac5065b222f6c4d
Deleted: sha256:841744bc2ab52c32261a0c5a5ba819a39e9b9ab5168ae671f6e58db4e935a4ba
Deleted: sha256:6f28ba549a8414f8ba1287b57f0063139457fceee2564cb1e9ae465de1201211
pb@xxx:~>docker pull php:7-fpm
7-fpm: Pulling from library/php
7268d8f794c4: Already exists
a3ed95caeb02: Pull complete
38331772e700: Pull complete
74507bbf90f9: Pull complete
c6734ca38ed8: Pull complete
17c11373d92e: Pull complete
d39787b2a4e7: Pull complete
5aa187f92868: Pull complete
f04da8fdd84a: Pull complete
Digest: sha256:a999d9857877490cea90f6a66bb19aa739cbcabac7e370493bc660fad74fc3bd
Status: Downloaded newer image for php:7-fpm
pb@xxx:~>docker run php:7-fpm
[24-Feb-2016 15:32:15] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[24-Feb-2016 15:32:15] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[24-Feb-2016 15:32:15] ERROR: FPM initialization failed
[24-Feb-2016 15:32:15] ERROR: FPM initialization failed
I can't reproduce: :disappointed:
$ docker pull php:7-fpm
7-fpm: Pulling from library/php
7268d8f794c4: Already exists
a3ed95caeb02: Pull complete
38331772e700: Pull complete
74507bbf90f9: Pull complete
c6734ca38ed8: Pull complete
17c11373d92e: Pull complete
d39787b2a4e7: Pull complete
5aa187f92868: Pull complete
f04da8fdd84a: Pull complete
Digest: sha256:a999d9857877490cea90f6a66bb19aa739cbcabac7e370493bc660fad74fc3bd
Status: Downloaded newer image for php:7-fpm
$ docker run -it --rm php:7-fpm
[24-Feb-2016 17:13:12] NOTICE: fpm is running, pid 1
[24-Feb-2016 17:13:12] NOTICE: ready to handle connections
@tianon I downloaded the Windows based Docker Toolbox v1.10.2 and tried it with the Docker Quickstart Terminal on Windows 7 at home: no problems, no errors ... the output is like yours.
Gonna try it tomorrow at work again.
Before I opened this issue I asked my workmate to pull the image on his machine... Same error(s) as in my first comment.
At work the both tested host machines runs Kubuntu 14.xx with Docker v1.10.1; maybe that's a hint.
I wonder if AppArmor is injecting itself here? Not sure. :confused:
I think not, because it's the only docker container producing errors.
Official docker containers of nginx (based also on debian:jessie), elasticsearch, logstash etc. run flawlessly at work.
It would be strange if AppArmor was selective on containers instead of the entire docker deamon itself.
It would be possible that it's being selective about what this container is
doing versus some other. It might be interesting to try some other
container which uses FastCGI, but I can't think of any other good examples
off the top of my head.
@tianon Hi there, coworker (and sysadmin) from SinErgy84 here. The problem is that we've disabled ipv6 on our desktops via the GRUB2 boot option ipv6.disable=1. After a reboot with enabled ipv6, everything works fine.
So the problem is that this docker image doesn't support clients without IPv6.
Closing, looks like the problem has been resolved; let me know if I closed this prematurely.
I think its still a problem that hosts without ipv6 support aren't supported.
I think the problem stems from https://github.com/docker-library/php/blob/b3678663d8df85a398bd7fc7bdb51d9f3cc93054/fpm-Dockerfile-block-2#L36. We want to listen on all interfaces, and I believe most users would rather default to everything than be limited to just IPv4.
You should be able to sed the php-fpm.d/zz-docker.conf file or replace it with a configuration that works with your machines (be sure not to lose the daemonize = no line).
Using 0.0.0.0 worked for me:
listen = 0.0.0.0:9000
Right, but if we go with "0.0.0.0" by default, the image will no longer
listen on all IPv6 interfaces, so I think our only real option here is to
consider this an edge case. :disappointed:
containers still failed to run without sed
@SinErgy84 hello , have you solved the problem,i met the same problem as you.
[root@iZ2576spf4xZ ~]# docker run lyen/php5.6
[18-Oct-2016 05:34:45] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[18-Oct-2016 05:34:45] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[18-Oct-2016 05:34:45] ERROR: FPM initialization failed
[18-Oct-2016 05:34:45] ERROR: FPM initialization failed
How is it?
I have the same issue because ipv6 disabled (
some guys said that Don鈥檛 use localhost unless you really support both ipv4 and ipv6. Instead, use 127.0.0.1 and ::1.(php-fpm.conf) ,
hi @lyenking,
as @Shuro mentioned the only solution back in time was to enable ipv6 on host machine -> see https://github.com/docker-library/php/issues/194#issuecomment-191119757
other solution was: build our own php-docker-image with custom settings
i don't remember if we tested your solution with 127.0.0.1 and ::1 instead of localhost per default: https://github.com/docker-library/php/blob/1c56325a69718a3e3cf76179e75d070b7e23da62/5.6/fpm/alpine/Dockerfile#L150
well, the solution with enabling IPv6 on the host machine is totally not acceptable
your canonical image is used everyvare!
i've spent two days trying to solve this problem here https://github.com/laradock/laradock/issues/442
a lot of people including me aren't able to modify THE HOST settings
You cant force us to enable IPv6 at all!
@mxswar the solution for non-IPv6 users is to include custom configuration to override this value -- the vast majority of users _do_ have IPv6 enabled (in most distros, it's enabled by default these days), and AFAIK, PHP-FPM does not include a way for us to specify "all" without choosing either IPv6+IPv4 or IPv4-exclusive, so we have to go with the default that covers the majority of users/use-cases :disappointed:
@shaula you save my time
for me it is a php-fpm issue: when I write listen 9000 it should listen on all available IP-Addresses on port 9000 not on [::]:9000 and 0.0.0.0:9000 and crash when [::]:9000 is not available
I didn't find any bug on php.net so I created one: https://bugs.php.net/bug.php?id=74166
Please vote for this bug if you think they should fix it.
This was officially fixed upstream in https://github.com/php/php-src/commit/b63c45c69e3a97b05314c6f3328a0ff695e28d36 (7.2+)!
See also https://github.com/docker-library/php/pull/562. :+1:
Most helpful comment
@tianon Hi there, coworker (and sysadmin) from SinErgy84 here. The problem is that we've disabled ipv6 on our desktops via the GRUB2 boot option
ipv6.disable=1. After a reboot with enabled ipv6, everything works fine.So the problem is that this docker image doesn't support clients without IPv6.