allow insecure registry in host provisioned with docker-machine

Montells picture Montells · Jun 4, 2015 · Viewed 28.6k times · Source

Is there anyway to configure --allow-insecure-ssl for docker's deamon created with docker-machine.

commands:

docker-machine create --driver virtualbox dev 
eval "$(docker-machine env dev)"
docker run myregistry:5000/busybox:latest echo 'hello world'

output:

Unable to find image 'myregistry:5000/busybox:latest' locally
2015/06/04 16:54:17 Error: v1 ping attempt failed with error: Get          
https://myregistry:5000/v1/_ping: EOF. If this private  
registry supports only HTTP or HTTPS with an unknown CA certificate, 
please add `--insecure-registry myregistry: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/myregistry:5000/ca.crt

Answer

enrique-carbonell picture enrique-carbonell · Jun 5, 2015

If you are running docker-machine version v0.2 stable, you can't set docker option in light way. But in next version v0.3 this problem was resolved with the creation parameters.

At this moment this feature it's on RC1,then you can use a version v0.3.0-RC-1 or wait for delivery the next stable version v0.3.0(tentatively Jun.16).

Then use parameter --engine-insecure-registry to set --allow-insecure-ssl for docker's daemon, for example:

docker-machine create --driver virtualbox --engine-insecure-registry myregistry:5000 dev

After that you can execute:

docker run myregistry:5000/busybox:latest echo 'hello world'

Additionally you can read about it on project doc.