Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

php-nginx:7.4-alpine dependency problems

Open jishi opened this issue 3 years ago • 2 comments

Step 12/27 : RUN apk update && apk add mariadb-client sudo php7-imagick
 ---> Running in 193081e40bd6
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
fetch https://dl-4.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
v3.13.5-179-gbbbf656a5c [https://dl-cdn.alpinelinux.org/alpine/v3.13/main]
v3.13.5-177-g88a337650c [https://dl-cdn.alpinelinux.org/alpine/v3.13/community]
v3.11.11-24-g127ddb5cee [https://dl-4.alpinelinux.org/alpine/v3.11/community/]
OK: 19815 distinct packages available
ERROR: unable to select packages:
  imagemagick-libs-7.0.10.57-r0:
    conflicts: imagemagick-libs-7.0.11.13-r0
    satisfies: imagemagick-7.0.10.57-r0[so:libMagickCore-7.Q16HDRI.so.8]
               imagemagick-7.0.10.57-r0[so:libMagickWand-7.Q16HDRI.so.8]
  imagemagick-libs-7.0.11.13-r0:
    conflicts: imagemagick-libs-7.0.10.57-r0
    satisfies: php7-pecl-imagick-3.4.4-r8[so:libMagickCore-7.Q16HDRI.so.9]
               php7-pecl-imagick-3.4.4-r8[so:libMagickWand-7.Q16HDRI.so.9]
The command '/bin/sh -c apk update && apk add mariadb-client sudo php7-imagick' returned a non-zero code: 4

Seems like alpine repos are having difficulties, or the base image is wrongly configured. Why it has package indexes for both 3.13 and 3.11 I'm not sure, and it seems broken, but what is even weirder to me, is that the webdevops/toolbox image that seems to be the base image for all your alpine images are derived from alpine:latest, so it will just select whatever is latest at the time of building and uploading the base image to docker? I'd assume that would be pinned to at least some minor image. toolbox was updated 5 days ago, and probably built on top of a broken alpine release, is my best bet.

jishi avatar Jun 07 '21 10:06 jishi

Seems like just removing

https://dl-4.alpinelinux.org/alpine/v3.11/community/

from /etc/apk/repositories removes this error. But still an inherent problem from running latest.

I did this to temporarily fix it:

FROM webdevops/php-nginx:7.4-alpine
RUN sed -i '/v3.11/d' /etc/apk/repositories

jishi avatar Jun 07 '21 10:06 jishi

Something is really, really broken with the latest alpine.

php7-imagick from 3.11 causes a downgrade, so obviously php7-imagick is already installed.

3.13 will cause an upgrade, and both of these will cause an incompatibility with PHP

bash-5.1# apk add php7-imagick
(1/4) Upgrading imagemagick-libs (7.0.10.57-r0 -> 7.0.11.13-r0)
(2/4) Upgrading imagemagick (7.0.10.57-r0 -> 7.0.11.13-r0)
(3/4) Installing php7-common (7.4.19-r0)
(4/4) Installing php7-pecl-imagick (3.4.4-r8)
Executing busybox-1.32.1-r6.trigger
OK: 277 MiB in 156 packages
bash-5.1# php --version
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so (Error loading shared library libMagickWand-7.Q16HDRI.so.8: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so)), /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20190902/imagick.so.so: No such file or directory)) in Unknown on line 0
PHP 7.4.19 (cli) (built: May  6 2021 22:27:36) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies

jishi avatar Jun 07 '21 13:06 jishi