docker push 镜像到本地仓库

root@ubuntu:# uname -a
Linux ubuntu 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

1、如果dockerhub的https证书是非权威机构的需要执行,需要添加证书信任

root@ubuntu:# echo -n | openssl s_client -showcerts -connect dockerhub.xx.com:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >> /etc/ssl/certs/dockerhub.xx.com.crt
root@ubuntu:# update-ca-certificates

2、修改/etc/docker/daemon.json

root@ubuntu:# cat /etc/docker/daemon.json 
{
"registry-mirrors": ["https://dockerhub.xx.com"] }

最后重启docker

root@ubuntu:# service docker restart

猜你喜欢

转载自www.cnblogs.com/zheh/p/9168346.html