docker service create doesn't find image

When I run docker service create –mode global foo myrepo/foo-img:0.1, it works in that it starts the service, but if foo-img:0.1 does not exist on a node in the swarm, that node emits the following error:

<containerid>   \_ foo    myrepo/foo:0.1  <snip>  "No such image: myrepo/foo-img:0.1"

If I pull myrepo/foo-img:0.1 on each node then it works fine.

  • Is it feasible to create docker file for each service of my node project?
  • Correct way to link redis to sinatra docker containers
  • Docker Automated build downloading private jars from a Maven Sonatype Nexus repository
  • Cannot start container : [8] System error: exec: “up3”: executable file not found in $PATH
  • What's the difference between Docker and Rocket from CoreOS?
  • Supervisor is not started into my docker container (Laravel project)
  • Is there a workaround for this other than pulling the image on each node in the swarm?

  • Secure gateway between Bluemix CF apps and containers
  • Pull private docker images from Google Container Registry w/o gcloud
  • how to mount volume in ElasticBeanstalk Docker container using only Dockerrun.aws.json
  • Docker access container logs from the host machine
  • Ubuntu nginx container 403 forbidden
  • Configure CodeSniffer on PhpStorm using Docker
  • One Solution collect form web for “docker service create doesn't find image”

    The answer is actually pretty simple. Use the--with-registry-auth parameter. This parameter uses the same authentication that is used for your current session. So, to make this work you simply:

    # docker login -u xxx -pass yyy https://myrepo.com
    # service create --with-registry-auth foo myrepo.com/foo-img:0.1
    

    Assuming that you successfully logged in, the service will pull the image from the repo to each node as needed. Not sure exactly what happens behind the scenes, but it works for deploying to all nodes currently in the cluster! Thanks to the help from the folks at github/docker!

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.