ERROR: http://mirrors.aliyun.com/alpine/v3.9/community: temporary error (try again later) WARNING: I
阿新 • • 發佈:2021-02-19
技術標籤:linux
在構建基礎映象時為了加速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
最終發現是由於/etc/docker/daemon.json檔案中dns配置錯誤導致的。
國內加速映象可以參考筆者的另一篇文章:https://jonhuster.blog.csdn.net/article/details/113846075