我正在尝试学习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上),并且有一个软件包似乎符合标准,它似乎正在寻找?
我很困惑为什么它似乎找到了包裹,但不会为我安装它。
答案 0 :(得分:1)
作曲家-1.5.2-R0: 掩盖在:@testing
似乎那个(可怕的过时!)Dockerfile的作者固定了测试库,所以你必须将@testing
附加到包名:
apk add composer@testing
但是,由于不同的PHP版本(v3.4版本很旧),我不希望它能够正常工作。