2017-10-18 65 views
0

我試圖學習Docker,並遇到了一個障礙。我的搬運工文件如下Dockerfile試圖'apk添加作曲家'失敗?

# 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) ,並且有一個似乎符合標準的軟件包,它似乎在尋找?

enter image description here

我很困惑,爲什麼它似乎找到了包,但不會安裝它適合我。

回答

1

作曲家-1.5.2-R0: 掩蓋了:@testing

看來那是作者Dockerfile固定測試庫,所以你必須要追加@testing到(可怕的過時!)包名稱:

apk add [email protected] 

不過,我不希望它因爲工作不同的PHP版本(V3.4是很老的版本)。

+0

ahhh好的,謝謝! :) –