群晖docker的tls(ssl)证书过期:x509: certificate has expired or is not yet valid

docker拉取镜像的时候报错证书过期:

在这里插入图片描述

Failed to pull image [error pulling image configuration: Get “https://production.cloudflare.docker.com/xxxxx”: x509: certificate has expired or is not yet valid: current time 2024-05-14T21:36:19+08:00 is after 2021-09-30T14:01:15Z].

在docker拉取镜像的 x509 报错,一般都是

1.系统时间问题

date 看一下系统时间对不对,如果服务器系统时间跟现实实际时间对不上的话,一般就是系统时间问题,同步时间即可。

2.证书问题

网上普遍的教程是:

编辑 /etc/docker/daemon.json文件

{
"registry-mirrors":["production.cloudflare.docker.com"]
}

然后重启docker服务,查看是否生效

docker info

,注意 Insecure Registries 字段.

 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

看不到刚刚添加的production.cloudflare.docker.com

!!!经测以上该方法在群晖上无效!!!

正确做法是

网上普遍的教程是:

编辑文件dockerd.json,旧版DSM所在位置:

/var/packages/Docker/etc/dockerd.json

在DSM 7.2中,Docker 名称改为“Container Manager”,因此:

/var/packages/ContainerManager/etc/dockerd.json

在文件中追加一行

"registry-mirrors":["production.cloudflare.docker.com"]

然后重启docker服务。

查看是否生效

docker info

,注意 Insecure Registries 字段.

 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  production.cloudflare.docker.com
  127.0.0.0/8
 Live Restore Enabled: false

可以看到“production.cloudflare.docker.com”

完毕

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值