ERROR: http://mirrors.aliyun.com/alpine/v3.9/community: temporary error (try again later) WARNING: I
在构建基础镜像时为了加速alpine系统的组件更新,使用了阿里云的镜像,部分Dockerfile文件如下所示:FROM openjdk:8-jdk-alpineRUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositoriesRUN apk update && apk upgrade &a
在构建基础镜像时为了加速alpine系统的组件更新,使用了阿里云的镜像,部分Dockerfile文件如下所示:
FROM openjdk:8-jdk-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk upgrade && apk add curl wget gettext tar bash && apk add ca-certificates && update-ca-certificates \
&& apk add tini busybox-extras \
&& apk add --update tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/cache/apk/*
执行docker build命令时却报错了下面的错误:
ERROR: https://mirrors.aliyun.com/alpine/v3.9/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.9552eaa3.tar.gz: No such file or directory
ERROR: https://mirrors.aliyun.com/alpine/v3.9/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.61802f13.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
最终发现是由于/etc/docker/daemon.json文件中dns配置错误导致的。
国内加速镜像可以参考笔者的另一篇文章:https://jonhuster.blog.csdn.net/article/details/113846075
PS:
DNS优先选择国内DNS服务器,见https://jonhuster.blog.csdn.net/article/details/116802463
更多推荐
所有评论(0)