標籤:size doc flow 退出 版本 roo reg blog c/s
系統內容:centos7
docker版本: 1.12.3(注意版本,可能存在不同版本設定不同的情況)
docker registry版本:2.4.1
問題:
成功安裝docker registry,在瀏覽器中輸入http://192.168.1.100:5000/v2,成功返回json資料。在push 到docker registry時,報:
[[email protected] sysconfig]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry]Get https://192.168.1.100:5000/v1/_ping: http: server gave HTTP response to HTTPS client
這個問題可能是由於docker registry 未採用https服務所致。
很多文章都是通過修改docker的設定檔“etc/systemconfig/docker",重啟docker來解決這個問題。但發現docker1.12.3版本並無此檔案,根據網上建立此檔案,並填入相應內容,重啟docker無效果,仍然報此錯誤。
解決方案:
在”/etc/docker/“目錄下,建立”daemon.json“檔案。在檔案中寫入:
{ "insecure-registries":["192.168.1.100:5000"] }
儲存退出後,重啟docker。問題解決:
[[email protected] docker]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry]ee8e809cfde5: Pushedba20d499f984: Pushed705e35f12f24: Pushed42755cf4ee95: Pushed2.4.1: digest: sha256:b66c4af9577744ae6d32e975808230e2ff558a5d50a7968d5102a900e147f3d5 size: 1158
參考文章:
http://stackoverflow.com/questions/38695515/can-not-pull-push-images-after-update-docker-to-1-12
centos7 docker registry push錯誤“server gave HTTP response to HTTPS client”