Joel Mitchell
Joel Mitchell

Reputation: 48

Dockerfile attempting to 'apk add composer' failing?

I am attempting to learn Docker, and have run into a snag. My docker file is as follows

# Base image of a nginx box
FROM richarvey/nginx-php-fpm:latest

ARG VERSION=0.0.0
ENV APP=jewel
ENV WEBROOT=/var/www/html/JEWEL_WEB_ROOT/

WORKDIR /var/www/html
COPY ./ ./

# Install composer libs
RUN echo "ipv6" >> /etc/modules
#RUN ["apk","update"]
RUN ["apk","add","composer", "--no-cache"]
RUN ["composer","install"]

ENV PORT=80
EXPOSE 80

When the build process gets to the apk add, I get the following:

Step 8/11 : RUN apk add composer --no-cache
 ---> Running in ffa506b1a07f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
fetch http://nl.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  composer-1.5.2-r0:
    masked in: @testing
    satisfies: world[composer]
ERROR: Service 'web' failed to build: The command 'apk add composer --no-cache' returned a non-zero code: 1

I've checked the package listings (on pkgs.alpinelinux.org), and there is a package that seems to meet the criteria, which it seems to be finding?

enter image description here

I am confused why it seems to find the package, but won't install it for me.

Upvotes: 0

Views: 4566

Answers (1)

Jakub Jirutka
Jakub Jirutka

Reputation: 10817

composer-1.5.2-r0: masked in: @testing

It seems that author of that (horribly outdated!) Dockerfile pinned testing repository, so you have to append @testing to the package name:

apk add composer@testing

However, I’d not expect it to work due to different PHP versions (v3.4 is very old release).

Upvotes: 2

Related Questions