使用dockerfile打包时 遇到的问题
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: temporary error (try again later)
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
tini (no such package):
required by: world[tini]
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/community: temporary error (try again later)
ERROR: unable to select packages:
fetch https://mirrors.aliyun.com/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
ERROR: https://mirrors.aliyun.com/alpine/v3.13/main: temporary error (try again later)
WARNING: Ignoring https://mirrors.aliyun.com/alpine/v3.13/main: No such file or directory
fetch https://mirrors.aliyun.com/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
ERROR: https://mirrors.aliyun.com/alpine/v3.13/community: temporary error (try again later)
WARNING: Ignoring https://mirrors.aliyun.com/alpine/v3.13/community: No such file or directory
FROM nginx:alpine
# 加入以下这两行
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update
RUN apk add openjdk8
# 字体,解决图片验证码报错问题 https://github.com/docker-library/openjdk/issues/73
RUN apk add ttf-dejavu
COPY ***.jar /data/***.jar
COPY /arthas-bin /data/arthas-bin/
WORKDIR /data/
# ENTRYPOINT java -jar /data/***.jar
ENV TZ="Asia/Shanghai"
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["java","-jar","/data/***.jar"]
如果还有这个问题 改一下daemon.json
增加host配置 如下
{
"registry-mirrors": [
"https://***.mirror.aliyuncs.com",
"https://reg-mirror.qiniu.com",
"https://docker.mirrors.ustc.edu.cn/"
],
"dns": [
"8.8.8.8",
"114.114.114.114"
],
"insecure-registries": []
}