冲高山linux(在码头工人)

时间:2017-11-17 06:02:48

标签: docker dockerfile alpine dash-shell

我试图在(dockerized)alpine linux中安装dash。 我的Dockerfile如下:

FROM alpine:latest

RUN \
    echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
    apk add --no-cache --update dash
ENV SHELL dash

CMD dash

我得到的输出:

Step 1/4 : FROM alpine:latest
 ---> 053cde6e8953
Step 2/4 : RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories &&     apk add --no-cache --update dash
 ---> Running in 680f3d4d7dda
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  dash-0.5.9.1-r0:
    masked in: @community
    satisfies: world[dash]
ERROR: Service 'dash_alpine' failed to build: The command '/bin/sh -c echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories &&     apk add --no-cache --update dash' returned a non-zero code: 1

然而,基于alpine linux软件包搜索,它似乎可以在社区仓库中找到:https://pkgs.alpinelinux.org/packages?name=dash&branch=edge&repo=&arch=&maintainer=

我应该改变什么才能让它发挥作用?

1 个答案:

答案 0 :(得分:1)

我认为您的echo行是错误的 这个文件适合我。

FROM alpine:edge
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk add -U --no-cache dash