修改/etc/sysconfig/docker
OPTIONS='--insecure-registry 192.168.0.179:5000' #CentOS 7系统
other_args='--insecure-registry 192.168.0.179:5000' #CentOS 6系统
若报以下错误的,解决办法:
Error response from daemon: Get https://10.10.239.222:5000/v1/_ping: http: server gave HTTP response to HTTPS client
只需要两步即可:
1,Create or modify /etc/docker/daemon.json
[root@localhost ~]# echo '{ "insecure-registries":["10.10.239.222:5000"] }' > /etc/docker/daemon.json
[root@localhost ~]# cat /etc/docker/daemon.json
{ "insecure-registries":["10.10.239.222:5000"] }
2,重载docker
root@localhost ~]# systemctl restart docker