在高山上冲刺 linux(docker)

dash on alpine linux (in docker)

我正在尝试在(码头化的)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 包搜索,它似乎在社区 repo 中可用:https://pkgs.alpinelinux.org/packages?name=dash&branch=edge&repo=&arch=&maintainer=

我应该更改什么才能使其正常工作?

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

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