0

Below is the Dockerfile I have for creating a docker image. It was working so great but today I tried to build image in --no-cache mode since than I am having the issue. The error message detail is given bellow.

I repeat, it was working fine but now runs into error. Tried searching few solutions but nothing worked.

In particular this command is not working curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

FROM alpine:edge

MAINTAINER SamratShakya <[email protected]>

# Install packages
RUN apk --update add \
        curl \
        php7 \
        php7-dom \
        php7-fpm \
        php7-mbstring \
        php7-mcrypt \
        php7-opcache \
        php7-pdo \
        php7-pdo_mysql \
        php7-pdo_pgsql \
        php7-mysqli \
        php7-xml \
        php7-simplexml \
        php7-common \
        php-simplexml \
        php7-phar \
        php7-openssl \
        php7-json \
        php7-ctype \
        php7-session \
        php7-tokenizer \
        php7-xmlwriter \
        nodejs \
        git \
        ca-certificates \
        nginx \
        wget \
        libcurl \
        php7-curl \
        supervisor \

        && rm -rf /var/cache/apk/*


RUN curl -sS https://getcomposer.org/installer | php \
  --install-dir=/usr/bin --filename=composer

This is the error message I get in jenkins logs.

Error message:

Step 4/21 : RUN curl -sS https://getcomposer.org/installer | php   --install-dir=/usr/bin --filename=composer

 ---> Running in f79b6610ae38

[91mError relocating /usr/bin/php: explicit_bzero: symbol not found
[0m[91mcurl: (23) Failed writing body (0 != 16133)

[0mThe command '/bin/sh -c curl -sS https://getcomposer.org/installer | php   --install-dir=/usr/bin --filename=composer' returned a non-zero code: 127
PROBLEM IN IMAGE BUILD !!
Build step 'Execute shell' marked build as failure
Finished: FAILURE
3
  • the command you say it's not working does not match the one in your Dockerfile Oct 5, 2018 at 8:24
  • i have just removed the few parameters and adding them does not matter too. Oct 5, 2018 at 11:30
  • so please update the error message and the Dockerfile with the correct command (without removing the --) Oct 5, 2018 at 12:01

2 Answers 2

0

Try again with:

RUN curl -sS https://getcomposer.org/installer | \
  php -- --install-dir=/usr/bin --filename=composer
0

Nothing worked for me so as a workaround, What I did is added the composer as multistage image. I added composer separately and copied it to my alpine image as bellow.

FROM composer:1.5.1 AS composer

FROM alpine:edge 
#copying composer from another image and making it work
COPY --from=php-composer /usr/bin/composer /usr/bin/composer
RUN  ln -s /usr/bin/php7 /usr/bin/php

Regarding the issue I had. I am not able to extract the exact cause

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.