I’ve just started using Docker for AWS and I got a stack up running with 3 manager nodes and 5 cluster nodes. Getting the stack running worked just fine. But for some reason I can’t get my own built image to run on AWS, however it works just fine locally. The image is located in a private docker hub repo. I’ve added the
with-registry-auth flag when creating the service on the management node but with no success so far. The service is started but the number of replicas is never increased.
The commands run:
# Locally $ docker build -t mycompany/myweb:0.0.1 . # Check that it works as expected locally $ docker run --rm -it --name myweb-web -P mycompany/myweb:0.0.1 $ docker push mycompany/myweb-web:0.0.1
Then I log into a management node using SSH and do:
$ docker login --username=mycompany --firstname.lastname@example.org $ docker service create --name myweb-web --with-registry-auth --replicas 3 --publish 80:80 mycompany/myweb-web $ docker service ls ID NAME REPLICAS IMAGE COMMAND 80xilds358u5 myweb-web 0/3 mycompany/myweb-web
For some reason the replicas are never created. Note, when trying with launching a container like nginx from a public repo, it works.
UPDATE: When using
docker services ps <serviceid> it seems that the image isn’t found. The error column says:
No such image: mycompany/myweb-web…. But it will be fetched from Docker Hub when running locally.
It sounds similar to this issue: Use of Docker Private Repo doesn't work properly with Docker for AWS
UPDATE 2: I just recreated the whole stack and made the image public then it works. I will do it over again, recreate the stack and try to create the service with the private image.
Thanks for a good service!