Docker Community Forums

Share and learn in the Docker community.

Docker-php-ext-install not found

FROM alpine:3.8

MAINTAINER antonio <adelicado@sistel.es>

RUN apk update && apk upgrade

#Añadir repositorios
RUN apk add --update \
	--repository http://dl-cdn.alpinelinux.org/alpine/v3.8/community/ \
	--repository http://dl-cdn.alpinelinux.org/alpine/v3.8/main/

#Instalar apache, php7.2 y extensiones
RUN apk update && apk upgrade && apk add bash git nano wget curl unzip lynx

RUN apk add php apache2

RUN docker-php-ext-install libapache2-mod-php7.2 php7.2-bcmath php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-dom php7.2-fpm

#Instalar composer
RUN cd /tmp && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer

#Vaciar cache
RUN rm -f /var/cache/apk/* && \
	rm -rf /tmp/* && \
	mkdir /run/apache2 && \
	mkdir -p /opt/utils && \
	mkdir /htdocs

EXPOSE 80

#Configurar apache
ADD script.sh /opt/utils/
RUN chmod +x /opt/utils/script.sh
RUN /opt/utils/script.sh


ENTRYPOINT ["/opt/utils/script.sh"]

Output:
Step 4/6 : RUN docker-php-ext-install libapache2-mod-php7.2 php7.2-bcmath php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-dom php7.2-fpm
—> Running in b4cbd9e8fd79
/bin/sh: docker-php-ext-install: not found
The command ‘/bin/sh -c docker-php-ext-install libapache2-mod-php7.2 php7.2-bcmath php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-dom php7.2-fpm’ returned a non-zero code: 127

Did you find a solution for this issue? I am having the same problem. I can build 7.2 and 7.3 images but I get the same error when attempting to build a 5.3.29 image.

No:slightly_frowning_face: