Can't pull image from docker registry when docker is pointing to a swarm

I’m having an issue with google container registry and dockerhub where docker pull returns the following errors.


  • Custom port forwarding to docker container
  • Flask, Gunicorn, NGINX, Docker : What is properly the way to config SERVER_NAME and proxy_pass?
  • docker exec is not working in cron
  • Cyclic backups of a docker postgresql container
  • run apps using audio in a docker container
  • Cannot connect Docker container to Weave network
  • Error: Status 403 trying to pull repository PROJECT_ID/IMAGE_NAME: “Unable to access the repository: PROJECT_ID/IMAGE_NAME; please verify that it exists and you have permission to access it (no valid credential was supplied).”


    Using default tag: latest test-node0: Pulling
    k8tems/hello-world:latest… : Error: image k8tems/hello-world not
    found Error: image k8tems/hello-world not found

    This only happens when docker is pointing to a swarm.

    Steps to reproduce:$PROJECT_ID
    echo pushing hello-world image to gcr
    docker pull hello-world
    docker tag hello-world $DOCKER_REGISTRY/hello-world
    docker push $DOCKER_REGISTRY/hello-world
    echo setting up key store
    docker-machine create \
        -d digitalocean \
    docker $(docker-machine config "$KEY_STORE") run -d \
        -p "8500:8500" \
        -h "consul" \
        progrium/consul -server -bootstrap
    eval $(docker-machine env "$KEY_STORE")
    docker-machine create \
            -d digitalocean \
            --swarm \
            --swarm-master \
            --swarm-discovery="consul://$(docker-machine ip "$KEY_STORE"):8500" \
            --engine-opt="cluster-store=consul://$(docker-machine ip "$KEY_STORE"):8500" \
            --engine-opt="cluster-advertise=eth0:2376" \
    echo this fails
    eval $(docker-machine env -swarm "$NODE_BASE"0)
    docker pull $DOCKER_REGISTRY/hello-world
    echo this succeeds
    eval $(docker-machine env "$NODE_BASE"0)
    docker pull $DOCKER_REGISTRY/hello-world

    Along with the above snippet, I’ve also tried forcing the remote docker version to 1.10.3 and swarm to 1.1.3 but the error still persists.

    ubuntu:~$ docker-machine ls | grep test
    test-keystore                -        digitalocean   Running   tcp://:2376                                       v1.10.3   
    test-node0                   *        digitalocean   Running   tcp://:2376    test-node0 (master)                v1.10.3   
    ubuntu:~$ docker exec swarm-agent-master /swarm -v
    swarm version 1.1.3 (7e9c6bd)
    ubuntu:~$ docker -v
    Docker version 1.10.2, build c3959b1

    Is there anything I can do to make this work with the -swarm flag or do I have to run the pull command for each node?

  • Can't build openjdk:8-jdk image directly
  • Dockerfile: why doesn't the bash command work?
  • Docker jetty application does not see files from volume
  • Docker service failed to build : return a non-zero code 1
  • PHP date.timezone not found with Docker & PHP-FPM
  • Docker Daemon is not working
  • One Solution collect form web for “Can't pull image from docker registry when docker is pointing to a swarm”

    Try JSON key file! It is a long-lived credential and much more consistent than access token when you are using clusters like swarm or kubernetes.

    Example command:
    docker login -e -u _json_key -p “$(cat keyfile.json)”

    Here is the page with more details:

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