我正在尝试构建一个基于 Alpine 的 docker 映像,我需要在其中安装一些软件包。这正是我想要做的:
FROM alpine:latest
RUN apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0
但是当我运行 docker build 时,这是我得到的错误:
RUN apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0
---> Running in a061dcd5071e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
ca-certificates-20171114-r0:
breaks: world[ca-certificates=20161130-r2]
openssl-1.0.2n-r0:
breaks: world[openssl=1.0.2k-r0]
The command '/bin/sh -c apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0' returned a non-zero code: 2
我尝试运行 apk update 并重新启动机器,但似乎没有任何效果。我可以 ping 并打开“ http://dl-cdn.alpinelinux.org/alpine/v3.7/main/ ”,知道这里出现此错误的原因是什么吗?或者我该如何解决?