docker 1.12.3版本搭建私有倉庫,上傳鏡像報錯:server gave HTTP response to HTTPS client」

系統環境:centos7html

docker版本: 1.12.3(注意版本,可能存在不一樣版本設置不一樣的狀況)docker

docker registry版本:2.4.1json

問題:centos

成功安裝docker registry,在瀏覽器中輸入http://192.168.1.100:5000/v2,成功返回json數據。在push 到docker registry時,報:瀏覽器

[root@master sysconfig]# docker push 192.168.1.100:5000/registry:2.4.1
The 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

這個問題多是因爲客戶端採用https,docker registry未採用https服務所致。一種處理方式是把客戶對地址「192.168.1.100:5000」請求改成http。post

目前不少文章都是經過修改docker的配置文件「etc/systemconfig/docker",重啓docker來解決這個問題。但發現docker1.12.3版本並沒有此文件,根據網上建立此文件,並填入相應內容,重啓docker無效果,仍然報此錯誤。centos7

 

解決方法:spa

在」/etc/docker/「目錄下,建立」daemon.json「文件。在文件中寫入:3d

{ "insecure-registries":["192.168.1.100:5000"] }

保存退出後,重啓docker。問題解決:code

複製代碼
[root@master docker]# docker push 192.168.1.100:5000/registry:2.4.1
The push refers to a repository [192.168.1.100:5000/registry]
ee8e809cfde5: Pushed
ba20d499f984: Pushed
705e35f12f24: Pushed
42755cf4ee95: Pushed
2.4.1: digest: sha256:b66c4af9577744ae6d32e975808230e2ff558a5d50a7968d5102a900e147f3d5 size: 1158轉載於:http://www.cnblogs.com/hobinly/p/6110624.html
相關文章
相關標籤/搜索