Starting a container from a private registry with docker

I am trying to run an image from a private registry using dockers.

I have an image that I have tagged and placed in a private registry. If I run this locally:

docker run -p 8000:8000 -d registry.mydomain.com:8080/myimage

It works fine.

If I activate my swarm and try to run from there:

$(docker-machine env --swarm swarm-master) docker login registry.mydomain.com:8080 docker run -p 8000:8000 -d registry.mydomain.com:8080/myimage

I get "Authentication Required".

I'm actually trying to do this using the dockers remote API, but first I think I should run it on the command line.

Is it possible?

Thanks!

+5
source share
1 answer

Just curious, are you using authentication but not SSL? I think docker only supports basic authentication over SSL. You could try launching a docker with an unsafe flag in order to at least try out the possibilities of the swarm.

 docker -d --insecure-registry registry.mydomain.com:8080 

The error you are getting is probably a docker-swarm host trying to pull an image from your registry, since the launch can be a short hand to pull this image and run it.

+1
source

Source: https://habr.com/ru/post/1215184/


All Articles