Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpine:3.11/php7.4: No releases available for package "pecl.php.net/imagick" #139

Closed
admantium-sg opened this issue May 14, 2021 · 4 comments
Assignees
Labels

Comments

@admantium-sg
Copy link

Hello,

I'm building a PHP server with alpine:3.12 and php-alpine.

After applying the "bintray is down" patch from #131 (comment), the build resumes, but I can not build the imagick extension.

Relevant Dockerfile:

ARG ALPINE_VERSION="3.11"

FROM alpine:${ALPINE_VERSION} as base
ENV PHP_VERSION="php7"

# Step 0 - Update
# bintray permission error - see https://github.com/codecasts/php-alpine/issues/131#issuecomment-823983749
ADD https://packages.whatwedo.ch/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub

RUN apk --update-cache add ca-certificates && \
    echo "https://packages.whatwedo.ch/php-alpine/v3.11/php-7.4" >> /etc/apk/repositories

# Step 1 - PHP base
RUN apk --no-cache add \
    ${PHP_VERSION} \
    zip \
    unzip

# Step 2 - PHP extensions
RUN apk --no-cache add \
    ${PHP_VERSION} \
    ${PHP_VERSION}-ctype \
    ${PHP_VERSION}-curl \
    ${PHP_VERSION}-dom \
    ${PHP_VERSION}-ftp \
    ${PHP_VERSION}-gd \
    ${PHP_VERSION}-iconv \
    ${PHP_VERSION}-imagick

Error Message

=> ERROR [base  6/15] RUN apk add --no-cache autoconf         build-base           10.3s
------
 > [base  6/15] RUN apk add --no-cache autoconf         build-base         imagemagick         imagemagick-libs         imagemagick-dev         pkgconfig         php7-dev     && pecl install imagick      && apk del autoconf         build-base         pkgconfig         php7-dev:
#10 1.128 fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
#10 1.370 fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
#10 1.587 fetch https://packages.whatwedo.ch/php-alpine/v3.11/php-7.4/x86_64/APKINDEX.tar.gz
#10 2.229 (1/21) Installing m4 (1.4.18-r1)
#10 2.318 (2/21) Installing perl (5.30.3-r0)
#10 3.372 (3/21) Installing autoconf (2.69-r2)
#10 3.509 (4/21) Installing binutils (2.33.1-r1)
#10 3.878 (5/21) Installing libmagic (5.37-r1)
#10 4.083 (6/21) Installing file (5.37-r1)
#10 4.159 (7/21) Installing isl (0.18-r0)
#10 4.214 (8/21) Installing libgomp (9.3.0-r0)
#10 4.299 (9/21) Installing libatomic (9.3.0-r0)
#10 4.378 (10/21) Installing mpfr4 (4.0.2-r1)
#10 4.405 (11/21) Installing mpc1 (1.1.0-r1)
#10 4.423 (12/21) Installing gcc (9.3.0-r0)
#10 6.194 (13/21) Installing musl-dev (1.1.24-r3)
#10 6.464 (14/21) Installing libc-dev (0.7.2-r0)
#10 6.542 (15/21) Installing g++ (9.3.0-r0)
#10 7.710 (16/21) Installing make (4.2.1-r2)
#10 7.794 (17/21) Installing fortify-headers (1.1-r0)
#10 7.873 (18/21) Installing build-base (0.5-r1)
#10 7.949 (19/21) Installing imagemagick-c++ (7.0.9.7-r0)
#10 7.974 (20/21) Installing imagemagick-dev (7.0.9.7-r0)
#10 8.072 (21/21) Installing php7-dev (7.4.14-r1)
#10 9.380 Executing busybox-1.31.1-r10.trigger
#10 9.417 OK: 390 MiB in 138 packages
#10 10.03 No releases available for package "pecl.php.net/imagick"
#10 10.03 install failed
@anhao
Copy link

anhao commented May 15, 2021

you can use php-imagick

You don't have to add the PHP version

@admantium-sg
Copy link
Author

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

@xarem
Copy link
Collaborator

xarem commented May 25, 2021

@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]

@admantium-sg
Copy link
Author

Thank you, Xarem, I could fix the build following your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants