Bob Dudan
Bob Dudan

Reputation: 97

Docker swarm, unable to pin image to digest upon service create

I have set up a docker swarm cluster composed of three workers and one manager. I want to launch a container on the three workers from an image build using a custom Dockerfile. The nodes are registered to the manager correctly :

docker node ls
ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
0viqhgcdwul2vhvmgxbv31eg0    worker1   Ready   Active        
mabikwr5ufwa7lv8xk0liyqbd    worker3   Ready   Active        
s1m1qiarlyfgtljghgomcztlb    worker2   Ready   Active        
tqp7m2ohzvgqc9c60aex4x9u5 *  manager   Ready   Drain         Leader

But when I execute the following command,

docker service create --replicas 3 -p 8080:8080 --name myService myImage

worker1 does not execute the container and I got the following error :

unable to pin image myImage to digest: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

It is always worker1 that fails, the others are just right and the image is working as expected on them. Where does it come from and how can I solve that problem ?

Upvotes: 4

Views: 6297

Answers (1)

Bob Dudan
Bob Dudan

Reputation: 97

Ok, my bad. I thought that the manager would somehow send the image to the other nodes but it doesn't obviously. And for some reason worker 2 and 3 had a copy of the image so they could find it but not the worker 1...

Anyway, thanks for the answers.

Upvotes: 3

Related Questions