docker registry的https錯誤解決


從docker1.3.2版本開始默認docker registry使用的是https,當你用docker pull 非https的docker regsitry的時候會報下面錯誤:

Java代碼   收藏代碼
  1. Error: Invalid registry endpoint ... Get ... If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add '--insecure-registry 192.168.1.103:5000' to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.1.103:5000/ca.crt  

 

解決方案:

Java代碼   收藏代碼
  1. vi /usr/lib/systemd/system/docker.service  

 

內容修改如下:

Java代碼   收藏代碼
  1. [Unit]  
  2. Description=Docker Application Container Engine  
  3. Documentation=http://docs.docker.com  
  4. After=network.target docker.socket  
  5. Requires=docker.socket  
  6.   
  7. [Service]  
  8. Type=notify  
  9. EnvironmentFile=-/etc/sysconfig/docker  
  10. EnvironmentFile=-/etc/sysconfig/docker-storage  
  11. ExecStart=/usr/bin/docker -d --insecure-registry 192.168.1.103:5000  -H fd:// $OPTIONS $DOCKER_STORAGE_OPTIONS  
  12. LimitNOFILE=1048576  
  13. LimitNPROC=1048576  
  14.   
  15. [Install]  
  16. WantedBy=multi-user.target  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM