dockerfile制作镜像 拉取不到 alpinelinux的问题记录

本文讲述了在使用Dockerfile构建时遇到的警告与错误,如Alpine源问题,如何通过修改repositories替换阿里云镜像源并解决tini缺失。还介绍了调整daemon.json以优化镜像源和DNS配置
摘要由CSDN通过智能技术生成

使用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": []
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值