mlocati/docker-php-extension-installer

It doesn't work in `php:7.0-cli-alpine` image

Closed this issue · 2 comments

suyar commented

Version of install-php-extensions

2.1.35

Error description

------
 > [3/3] RUN chmod +x /usr/local/bin/install-php-extensions &&     install-php-extensions @fix_letsencrypt apcu:
#0 0.331 install-php-extensions v.2.1.35
#0 0.331 #StandWithUkraine
#0 0.372 ### FIXING LETS ENCRYPT CA CERTIFICATES ###
#0 0.372 - old Alpine Linux detected: we should fix the certificates
#0 0.373 - disabling the DST_Root_CA_X3 certificate
#0 0.373 - refreshing the certificates
#0 0.416 WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping
#0 1.393 Updating channel "pecl.php.net"
#0 6.925 Update of Channel "pecl.php.net" succeeded
#0 6.928 fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
#0 8.171 fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
#0 8.638 v3.7.3-184-gffd32bfd09 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
#0 8.638 v3.7.3-194-gcddd1b2302 [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
#0 8.638 OK: 9061 distinct packages available
#0 8.792 ### INSTALLING REQUIRED PACKAGES ###
#0 8.792 # Packages to be kept after installation:
#0 8.792 # Packages to be used only for installation: m4 libbz2 perl autoconf dpkg pkgconf dpkg-dev libmagic file libgcc libstdc++ binutils-libs binutils gmp isl libgomp libatomic mpfr3 mpc1 gcc musl-dev libc-dev g++ make re2c
#0 8.847 (1/27) Upgrading musl (1.1.18-r3 -> 1.1.18-r4)
#0 9.253 (2/27) Installing m4 (1.4.18-r0)
#0 9.380 (3/27) Installing libbz2 (1.0.6-r7)
#0 9.482 (4/27) Installing perl (5.26.3-r0)
#0 14.71 (5/27) Installing autoconf (2.69-r0)
#0 15.09 (6/27) Installing binutils-libs (2.30-r2)
#0 15.56 (7/27) Installing binutils (2.30-r2)
#0 18.06 (8/27) Installing dpkg (1.18.24-r0)
#0 18.76 (9/27) Installing pkgconf (1.3.10-r0)
#0 18.91 (10/27) Installing dpkg-dev (1.18.24-r0)
#0 19.35 (11/27) Installing libmagic (5.32-r2)
#0 19.91 (12/27) Installing file (5.32-r2)
#0 20.01 (13/27) Installing libgcc (6.4.0-r5)
#0 20.17 (14/27) Installing libstdc++ (6.4.0-r5)
#0 20.58 (15/27) Installing gmp (6.1.2-r1)
#0 20.80 (16/27) Installing isl (0.18-r0)
#0 21.25 (17/27) Installing libgomp (6.4.0-r5)
#0 21.38 (18/27) Installing libatomic (6.4.0-r5)
#0 21.48 (19/27) Installing mpfr3 (3.1.5-r1)
#0 21.69 (20/27) Installing mpc1 (1.0.3-r1)
#0 21.82 (21/27) Installing gcc (6.4.0-r5)
#0 37.91 (22/27) Installing musl-dev (1.1.18-r4)
#0 39.75 (23/27) Installing libc-dev (0.7.1-r0)
#0 39.85 (24/27) Installing g++ (6.4.0-r5)
#0 49.62 (25/27) Upgrading musl-utils (1.1.18-r3 -> 1.1.18-r4)
#0 49.75 (26/27) Installing make (4.2.1-r0)
#0 49.91 (27/27) Installing re2c (1.0.2-r0)
#0 50.10 Executing busybox-1.27.2-r11.trigger
#0 50.11 OK: 218 MiB in 53 packages
#0 50.18 ### INSTALLING REMOTE MODULE apcu ###
#0 50.74 No releases available for package "pecl.php.net/apcu"
#0 50.74 install failed
------
Dockerfile:5
--------------------
   4 |
   5 | >>> RUN chmod +x /usr/local/bin/install-php-extensions && \
   6 | >>>     install-php-extensions @fix_letsencrypt apcu
   7 |
--------------------
ERROR: failed to solve: process "/bin/sh -c chmod +x /usr/local/bin/install-php-extensions &&     install-php-extensions @fix_letsencrypt apcu" did not complete successfully: exit code: 1

I know this is a CA certificate problem, I have tried many ways but can not solve it.

Docker image

php:7.0-cli-alpine

Minimal Dockerfile

FROM php:7.0-cli-alpine

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions @fix_letsencrypt apcu

See #763

If you can find a solution, please submit a pull request (I tried very hard, unsuccessfully).

suyar commented

Thanks for your efforts, if I can find a solution I will come back and submit the pr, I will close this issue first.