Dockerfile 试图 'apk add composer' 失败?

Dockerfile attempting to 'apk add composer' failing?

我正在尝试学习 Docker,但 运行 遇到了麻烦。我的docker文件如下

# 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

当构建过程到达 apk 添加时,我得到以下信息:

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

我已经检查了软件包列表(在 pkgs.alpinelinux.org 上),似乎有一个软件包符合条件,它似乎正在寻找?

我很困惑为什么它似乎找到了包,但不会为我安装它。

composer-1.5.2-r0: masked in: @testing

似乎那个(非常过时!)Dockerfile 的作者固定了测试存储库,所以你必须将 @testing 附加到包名称:

apk add composer@testing

但是,由于 PHP 版本不同(v3.4 是非常旧的版本),我不希望它能正常工作。