Closed admantium-sg closed 3 years ago
you can use php-imagick
You don't have to add the PHP version
Hello anhao,
I could not rewsolve the issue by installing just php-imagick
. Same error message:
#10 11.50 (66/69) Installing imagemagick (7.0.10.48-r0)
#10 11.63 (67/69) Installing imagemagick-c++ (7.0.10.48-r0)
#10 11.66 (68/69) Installing imagemagick-dev (7.0.10.48-r0)
#10 11.72 (69/69) Installing php7-dev (7.4.14-r1)
#10 12.07 Executing busybox-1.31.1-r20.trigger
#10 12.30 Executing fontconfig-2.13.1-r2.trigger
#10 14.33 Executing shared-mime-info-1.15-r0.trigger
#10 15.47 Executing gdk-pixbuf-2.40.0-r3.trigger
#10 15.52 OK: 425 MiB in 140 packages
#10 16.29 No releases available for package "pecl.php.net/imagick"
#10 16.29 install failed
@admantium-sg i'd suggest to use an alias for repositories because it seems that it uses some official packages
Example
FROM alpine:3.11 as base
RUN ALPINE_VERSION=`cat /etc/alpine-release | cut -d'.' -f-2` && \
wget -O /etc/apk/keys/php-alpine.rsa.pub https://packages.whatwedo.ch/php-alpine.rsa.pub && \
echo "@php https://packages.whatwedo.ch/php-alpine/v$ALPINE_VERSION/php-7.4" >> /etc/apk/repositories && \
apk --no-cache add \
php7@php \
php7-ctype@php \
php7-curl@php \
php7-dom@php \
php7-ftp@php \
php7-gd@php \
php7-iconv@php \
php7-imagick@php
Result:
$ docker build . -t imagick-test
[+] Building 0.5s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.11 0.5s
=> [1/2] FROM docker.io/library/alpine:3.11@sha256:18a918a714d1368847b67173d120ebd110fcfae208305412f3005a61cdc7c20e 0.0s
=> CACHED [2/2] RUN ALPINE_VERSION=`cat /etc/alpine-release | cut -d'.' -f-2` && wget -O /etc/apk/keys/php-alpin 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:8d1d5a5ee3fbebfea65424f455e619ffab2962f5aa66af7c0bddbcec7d786982 0.0s
=> => naming to docker.io/library/imagick-test 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
$ docker run -i imagick-test php7 -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
imagick <----------------------
libxml
pcre
readline
Reflection
SimpleXML
SPL
standard
tokenizer
xml
xmlwriter
[Zend Modules]
Thank you, Xarem, I could fix the build following your suggestion.
Hello,
I'm building a PHP server with
alpine:3.12
andphp-alpine
.After applying the "bintray is down" patch from https://github.com/codecasts/php-alpine/issues/131#issuecomment-823983749, the build resumes, but I can not build the
imagick
extension.Relevant Dockerfile:
Error Message