Add Insecure Registry to Docker

后端 未结 6 926
醉话见心
醉话见心 2020-12-12 11:24

I have a docker 1.12 running on CentOS. I am trying to add insecure registry to it and things mentioned in documentation just don\'t work. The system uses systemd

6条回答
  •  自闭症患者
    2020-12-12 12:15

    The solution with the /etc/docker/daemon.json file didn't work for me on Ubuntu.

    I was able to configure Docker insecure registries on Ubuntu by providing command line options to the Docker daemon in /etc/default/docker file, e.g.:

    # /etc/default/docker    
    DOCKER_OPTS="--insecure-registry=a.example.com --insecure-registry=b.example.com"
    

    The same way can be used to configure custom directory for docker images and volumes storage, default DNS servers, etc..

    Now, after the Docker daemon has restarted (after executing sudo service docker restart), running docker info will show:

    Insecure Registries:
      a.example.com
      b.example.com
      127.0.0.0/8
    

提交回复
热议问题