Machine: Insecure registry setup not clear for Docker Machine

Created on 13 May 2016  路  6Comments  路  Source: docker/machine

I recently setup docker-machine on my windows development desktop and docker engine on our build repository machine in the task of integrating docker into our build process. I setup a private repository and have been struggling with connecting to it from the windows machine docker client. After much struggling I found the line I had glossed over in the documentation on insecure private registries:

  1. Repeat this configuration on every Engine host that wants to access your registry.

However, how to do this on the boot2docker default machine that was created was not clear and none of the documentation included the correct location of the files.

After parsing the service script I come up with the following steps for setting up an insecure private registry in docker machine default boot2docker instance:

  1. docker-machine ssh default
  2. sudo vi /var/lib/boot2docker/profile
  3. edit EXTRA_ARGS line add --insecure-registry hostename/ip:port

Can these or any more canonical instructions be added to the Docker Machine documentation?

Most helpful comment

You can also change /etc/docker/daemon.json on docker-machine:

{"insecure-registries":["docker-machine:5000"]}

Don't forget to restart docker service:

sudo /etc/init.d/docker restart

All 6 comments

To accomplish this in docker-machine add --engine-insecure-registry hostname:port to your docker-machine create command.

My point was for a docker machine that already existed, not for when creating a new machine.

You can also change /etc/docker/daemon.json on docker-machine:

{"insecure-registries":["docker-machine:5000"]}

Don't forget to restart docker service:

sudo /etc/init.d/docker restart

@jonl-percsolutions-com I totally agree. It has been most frustrating to hook up Docker with Windows using an existing registry. I'm still trying to connect my doctor registry on another VM with my local Docker.

well, if you're running your docker-machine from boot2docker (the default), you can follow these steps to add the "create extra agrs" on an existing machine

To make sure the changes in /etc/docker/daemon.json work you have to ensure:

  • access rights to the file : chmod 744 /etc/docker/daemon.json
  • {"insecure-registries":["ip_address_of_the_docker_machine:5000"]}
Was this page helpful?
0 / 5 - 0 ratings