codecasts / php-alpine

PHP APK Repository for Alpine Linux
https://github.com/codecasts/php-alpine
483 stars 58 forks source link

php-bcmath not found #81

Closed Jarvvski closed 4 years ago

Jarvvski commented 5 years ago

Apologies for the short title, but I'm not sure what else it could be!

In my project I couldn't get this to work, so I boiled it down to a simple dockerfile to successfully reproduce it:

FROM nginx:alpine

# trust this project public key to trust the packages.
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub

# make sure you can use HTTPS
RUN apk --update add ca-certificates

# IMAGE ARGUMENTS WITH DEFAULTS.
ARG PHP_VERSION=7.3
ARG ALPINE_VERSION=3.9
ARG NGINX_HTTP_PORT=8080
ARG NGINX_HTTPS_PORT=443

# CONFIGURE ALPINE REPOSITORIES AND PHP BUILD DIR.
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
    echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories && \
    echo "https://dl.bintray.com/php-alpine/v${ALPINE_VERSION}/php-${PHP_VERSION}" >> /etc/apk/repositories

# INSTALL PHP AND SOME EXTENSIONS. SEE: https://github.com/codecasts/php-alpine
RUN apk add --no-cache --update php-fpm \
    php \
    php-openssl \
    php-pdo \
    php-pdo_mysql \
    php-mbstring \
    php-phar \
    php-session \
    php-dom \
    php-ctype \
    php-zlib \
    php-json \
    php-xml && \
    php-bcmath && \
    ln -s /usr/bin/php7 /usr/bin/php

With response:

Step 1/9 : FROM nginx:alpine
 ---> 9a2868cac230
Step 2/9 : ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
Downloading [==================================================>]     451B/451B
 ---> Using cache
 ---> e86d9599aa0e
Step 3/9 : RUN apk --update add ca-certificates
 ---> Using cache
 ---> e0470973a354
Step 4/9 : ARG PHP_VERSION=7.3
 ---> Using cache
 ---> 0a1126621565
Step 5/9 : ARG ALPINE_VERSION=3.9
 ---> Using cache
 ---> 94eb806792de
Step 6/9 : ARG NGINX_HTTP_PORT=8080
 ---> Using cache
 ---> fa7f583298ff
Step 7/9 : ARG NGINX_HTTPS_PORT=443
 ---> Using cache
 ---> fae6c55e5083
Step 8/9 : RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories &&     echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories &&     echo "https://dl.bintray.com/php-alpine/v${ALPINE_VERSION}/php-${PHP_VERSION}" >> /etc/apk/repositories
 ---> Using cache
 ---> d00987c9c881
Step 9/9 : RUN apk add --no-cache --update php-fpm     php     php-openssl     php-pdo     php-pdo_mysql     php-mbstring     php-phar     php-session     php-dom     php-ctype     php-zlib     php-json     php-xml &&     php-bcmath &&     ln -s /usr/bin/php7 /usr/bin/php
 ---> Running in c839e7401b8d
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
fetch https://dl.bintray.com/php-alpine/v3.9/php-7.3/x86_64/APKINDEX.tar.gz
(1/22) Installing php7-common (7.3.5-r1)
(2/22) Installing argon2-libs (20171227-r2)
(3/22) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(4/22) Installing ncurses-terminfo (6.1_p20190105-r0)
(5/22) Installing ncurses-libs (6.1_p20190105-r0)
(6/22) Installing libedit (20181209.3.1-r0)
(7/22) Installing pcre2 (10.32-r1)
(8/22) Installing php7 (7.3.5-r1)
(9/22) Installing php7-ctype (7.3.5-r1)
(10/22) Installing expat (2.2.6-r0)
(11/22) Installing php7-xml (7.3.5-r1)
(12/22) Installing php7-dom (7.3.5-r1)
(13/22) Installing php7-fpm (7.3.5-r1)
(14/22) Installing php7-json (7.3.5-r1)
(15/22) Installing php7-mbstring (7.3.5-r1)
(16/22) Installing php7-openssl (7.3.5-r1)
(17/22) Installing php7-pdo (7.3.5-r1)
(18/22) Installing php7-mysqlnd (7.3.5-r1)
(19/22) Installing php7-pdo_mysql (7.3.5-r1)
(20/22) Installing php7-phar (7.3.5-r1)
(21/22) Installing php7-session (7.3.5-r1)
(22/22) Installing php7-zlib (7.3.5-r1)
Executing busybox-1.29.3-r10.trigger
OK: 56 MiB in 52 packages
/bin/sh: php-bcmath: not found
The command '/bin/sh -c apk add --no-cache --update php-fpm     php     php-openssl     php-pdo     php-pdo_mysql     php-mbstring     php-phar     php-session     php-dom     php-ctype     php-zlib     php-json     php-xml &&     php-bcmath &&     ln -s /usr/bin/php7 /usr/bin/php' returned a non-zero code: 12

Any ideas what I'm doing wrong in particular? I see it's in the readme and is available in the repository directly. I'm hoping it's some silly thing I'm missing, but sadly I've gotten to the stage where I can't see it myself

Jarvvski commented 5 years ago

I'm tired.. I've just noticed it

    php-xml && \
    php-bcmath && \

Would try to call php-bcmath as a shell command.

Sorry!

hernandev commented 4 years ago

no worries