Step 1/2 : FROM php:7.1-fpm
7.1-fpm: Pulling from library/php
Status: Downloaded newer image for php:7.1-fpm
Step 2/2 : RUN pecl install redis-3.1.0 && pecl install xdebug-2.5.0 && docker-php-ext-enable redis xdebug
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/redis requires PHP (version >= 5.2.0, version <= 7.1.0), installed version is 7.1.5
No valid packages found
install failed
Interesting -- possibly something we need to run at image build-time.
Here's some deets about what the impact might be (for further exploration):
$ docker run -it --rm --name test php:7-alpine sh
/ # pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
```console
$ docker diff test
C /root
A /root/.ash_history
A /root/.pearrc
C /tmp
C /tmp/pear
C /tmp/pear/temp
A /tmp/pear/temp/channel.xml
C /usr
C /usr/local
C /usr/local/lib
C /usr/local/lib/php
C /usr/local/lib/php/.channels
C /usr/local/lib/php/.channels/.alias
C /usr/local/lib/php/.channels/.alias/pecl.txt
C /usr/local/lib/php/.channels/pecl.php.net.reg
C /usr/local/lib/php/.lock
```console
$ docker ps -s | grep test
26e45617eed3 php:7-alpine "docker-php-entryp..." 7 seconds ago Up 6 seconds test 1.73kB (virtual 56.8MB)
(yes, ~1.73kB)
Slightly better example:
$ docker run -it --rm --name test php:7-alpine sh
/ # pecl update-channels
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
$ docker diff test
C /root
A /root/.ash_history
A /root/.pearrc
C /tmp
C /tmp/pear
C /tmp/pear/temp
A /tmp/pear/temp/channel.xml
C /usr
C /usr/local
C /usr/local/lib
C /usr/local/lib/php
C /usr/local/lib/php/.channels
C /usr/local/lib/php/.channels/.alias
C /usr/local/lib/php/.channels/.alias/pear.txt
C /usr/local/lib/php/.channels/.alias/pecl.txt
C /usr/local/lib/php/.channels/.alias/phpdocs.txt
C /usr/local/lib/php/.channels/doc.php.net.reg
C /usr/local/lib/php/.channels/pear.php.net.reg
C /usr/local/lib/php/.channels/pecl.php.net.reg
C /usr/local/lib/php/.lock
$ docker ps -s | grep test
585462856b9b php:7-alpine "docker-php-entryp..." 16 seconds ago Up 15 seconds test 4.75kB (virtual 56.8MB)
(~4.75kB)
@tianon I'm experiencing similar issue:
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded
Could not download from "http://pecl.php.net/get/apcu-5.1.11.tgz", cannot download "pecl/apcu" (File http://pecl.php.net:80/get/apcu-5.1.11.tgz not valid (received: HTTP/1.1 503 Service Unavailable
))
Error: cannot download "pecl/apcu"
Download failed
install failed
It looks that "Service Unavailable" but I'm able to download "http://pecl.php.net:80/get/apcu-5.1.11.tgz" the file manually.
@torinaki that sounds like an environmental, firewall, or upstream service issue, not something related to this image
I'd recommend trying the Docker Community Forums, the Docker Community Slack, or Stack Overflow for help determining the root cause of that issue.
I don't know if docker is failing somewhere silently or if there is some caching but I just had to re-run
pecl update-channels; rm -rf /tmp/pear ~/.pearrc
It's in the dockerfile. I have no idea why pulling php:7.2 is not running that line, but it's not. As a result trying to get xdebug to build leads to an error.
Need a PHP version >= 5.5.0 and < 7.2.0 (found 7.2.7)
Strange, it works here without needing another pecl update-channels
output
```console
$ docker run --rm -dit --name php1 php:7.2
$ docker exec -it php1 bash
root@02542c0b46ee:/# pecl install xdebug
downloading xdebug-2.6.0.tgz ...
Starting to download xdebug-2.6.0.tgz (283,644 bytes)
.....done: 283,644 bytes
79 source files, building
running: phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
building in /tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0
running: /tmp/pear/temp/xdebug/configure --with-php-config=/usr/local/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable Xdebug support... yes, shared
checking whether to enable Xdebug developer build flags... no
checking Check for supported PHP versions... supported (7.2.7)
checking for gettimeofday... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for cos in -lm... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
. . .
(cd .libs && rm -f xdebug.la && ln -s ../xdebug.la xdebug.la)
/bin/bash /tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0/libtool --mode=install cp ./xdebug.la /tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0/modules
cp ./.libs/xdebug.so /tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0/modules/xdebug.so
cp ./.libs/xdebug.lai /tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0/modules/xdebug.la
Libraries have been installed in:
/tmp/pear/temp/pear-build-defaultuserU9FKQQ/xdebug-2.6.0/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
See any operating system documentation about shared libraries for
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0" install
Installing shared extensions: /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib/php/extensions/no-debug-non-zts-20170718/
+----------------------------------------------------------------------+
| |
| INSTALLATION INSTRUCTIONS |
| ========================= |
| |
| See http://xdebug.org/install.php#configure-php for instructions |
| on how to enable Xdebug for PHP. |
| |
| Documentation is available online as well: |
| - A list of all settings: http://xdebug.org/docs-settings.php |
| - A list of all functions: http://xdebug.org/docs-functions.php |
| - Profiling instructions: http://xdebug.org/docs-profiling2.php |
| - Remote debugging: http://xdebug.org/docs-debugger.php |
| |
| |
| NOTE: Please disregard the message |
| You should add "extension=xdebug.so" to php.ini |
| that is emitted by the PECL installer. This does not work for |
| Xdebug. |
| |
+----------------------------------------------------------------------+
running: find "/tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0" | xargs ls -dils
687 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0
1073 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr
1074 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local
1075 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib
1076 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib/php
1077 4 drwxr-xr-x 3 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib/php/extensions
1078 4 drwxr-xr-x 2 root root 4096 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib/php/extensions/no-debug-non-zts-20170718
1067 1568 -rwxr-xr-x 1 root root 1603136 Jul 12 17:59 /tmp/pear/temp/pear-build-defaultuserU9FKQQ/install-xdebug-2.6.0/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.6.0
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so" to php.ini
Where are you running that? Mine was in Travis-CI using matrix builds to make Docker images.
This line is definitely getting run, but it is possible that the protocols have been updated again since the last time the image was built.
If there's something environmental causing this, then there's even less chance there's anything we can really do here.
Looking at the build log you posted (which is much easier to read at https://travis-ci.org/CODESIGN2/docker-php/jobs/403109444), I don't see any errors related to PECL -- in fact, it appears to be failing to install mcrypt?
I believe you've got an issue where you define ARG PHP_VERSION before you FROM php:XXX, which then includes ENV PHP_VERSION (which overwrites your build arg with 7.2.7), and thus when you do ENV PHP_VERSION ${PHP_VERSION} later, you're not getting your build arg, but instead are getting the environment variable from the base image, which screws up your if statements that compare against PHP_VERSION expecting just 7.2 (and getting 7.2.7 instead).
Most helpful comment
Slightly better example:
(~4.75kB)