docker 1.12設置非https訪問registry

升級docker到1.12後,發現使用原來的/etc/sysconfig/docker文件中設置--insecure-registry的方式,訪問registry失敗,提示「http: server gave HTTP response to HTTPS client」。docker

[root@localhost ~]# docker login registry:5000
Username :        
Password:
Error response from daemon: Get https://registry:5000/v1/users/: http: server gave HTTP response to HTTPS client


多方搜索後,原來是docker修改了--insecure-registry的配置方式,改成使用json文件配置了。json

建立/etc/docker/daemon.json文件,內容爲{ "insecure-registries":["registry:5000"] }。spa

[root@localhost ~]# cat /etc/docker/daemon.json
{ "insecure-registries":["registry:5000"] }


而後,重啓docker服務便可訪問registry。code

相關文章
相關標籤/搜索