在k8s集群中经常会通过helm安装下载一些开源软件,其中使用的镜像存放在官方或者私有者仓库中,这种就存在很大的不确定性,经过一段时间会发现服务找不到镜像的情况,毕竟这种受制于人的情况,我们最好少发生,否则很被动,这种情况,我们就可以将官方的镜像拉到本地,然后推送到我们自己的镜像仓库。
1、docker tag
docker tag qqshfox/cert-manager-webhook-dnspod:0.2.0 registry.cn-hangzhou.aliyuncs.com/wlcroxy/cert-manager-webhook-dnspod:0.2.0
2、docker login
docker login registry.cn-hangzhou.aliyuncs.com
3、docker push
docker push registry.cn-hangzhou.aliyuncs.com/wlcroxy/cert-manager-webhook-dnspod:0.2.0
推送完成后,可以检查下推送是否有效,下次使用这部分镜像时,就可以在自己仓库中找,不必有求于人。