Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow multiple '--insecure-registry' for docker registry

As we all known, we can add one --insecure-registry to the /etc/default/docker config file to allow insecure registry, like this:

DOCKER_OPTS="$DOCKER_OPTS --insecure-registry myregistry:5000"

My question is: Does it support adding more than one --insecure-registry since we need to communicate with more than one registries ?

like image 908
mainframer Avatar asked Oct 16 '15 12:10

mainframer


Video Answer


2 Answers

You can specify multiple insecure registries by lining them up:

--insecure-registry IP1:PORT --insecure-registry IP2:PORT --insecure-registry IP3:PORT

Source: https://github.com/docker/docker/issues/9026

like image 151
michaelbahr Avatar answered Sep 18 '22 06:09

michaelbahr


Docker 17.xx +

  1. Edit the daemon.json file, whose default location is /etc/docker/daemon.json on Linux or C:\ProgramData\docker\config\daemon.json on Windows Server

    If the daemon.json file does not exist, create it.

    {
          "insecure-registries": ["myregistry:5000", "anotherregistry:5000"]
    }
    
  2. Restart Docker for the changes to take effect. In Ubuntu would be like this:

    $ sudo systemctl daemon-reload
    $ sudo systemctl restart docker
    

Find more details in official documentation page https://docs.docker.com/registry/insecure/

like image 23
Camilo Silva Avatar answered Sep 18 '22 06:09

Camilo Silva