一、docker push 提示:x509: certificate signed by unknown authority

1、打开daemon.json,在insecure-registries里面添加你的私库地址

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
vim /etc/docker/daemon.json
{
"registry-mirrors":["https://xxx.aliyuncs.com"], #镜像加速地址
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "3"
},
"max-concurrent-downloads": 10,
"max-concurrent-uploads": 10,
"data-root": "/var/lib/docker",
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
],
"insecure-registries":["192.168.2.xxx:443"]
}
# 部分参数(registry-mirrors、insecure-registries ...)修改,只要reconfigure(systemctl reload docker) 就生效。insecure-registries 修改需要重启docker。

2、重启Docker

1
systemctl restart docker

这样就可以了。先docker login,然后再docker push。