patterndockerMinor
Access private DockerHub repo in Docker Swarm
Viewed 0 times
swarmdockerhubdockerprivateaccessrepo
Problem
I am trying to deploy a docker swarm using Digital Ocean's docker-machine driver.
This is currently a single node that contains several public DockerHub images, and one private.
I am having difficulties in configuring it to accept the private image properly.
I have SSHed into the node, and used
But, when trying to run
What do I need to do to properly login to a private registry in docker swarm mode?
This is currently a single node that contains several public DockerHub images, and one private.
I am having difficulties in configuring it to accept the private image properly.
I have SSHed into the node, and used
docker login. After that, I was able to properly docker pull the private image. But, when trying to run
docker stack deploy -c myapp.yml myapp, I am getting this warning:image me/myapp:latest could not be accessed on a registry to record
its digest. Each node will access me/myapp:latest independently,
possibly leading to different nodes running different versions of the image.What do I need to do to properly login to a private registry in docker swarm mode?
Solution
You need the
From the
--with-registry-auth flag, e.g.:docker stack deploy -c myapp.yml --with-registry-auth myappFrom the
docker stack deploy --help output:--with-registry-auth Send registry authentication details to Swarm agentsCode Snippets
docker stack deploy -c myapp.yml --with-registry-auth myapp--with-registry-auth Send registry authentication details to Swarm agentsContext
StackExchange DevOps Q#9444, answer score: 3
Revisions (0)
No revisions yet.