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.


  • How to completely destroy docker container from marathon UI?
  • Docker - Run Jetty on HTTPS
  • docker build running out of memory, but plenty of memory seems to be available
  • How to set up Docker development environment on Debian?
  • Journalctl : add _SYSTEMD_UNIT field into log printout
  • Travis-CI: docker image as build environment
  • 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?

  • How to develop applications with Docker which are in separate repositories
  • Gitlab-CI PHP executable returning error code 255
  • getting docker container to never shutdown
  • Share mountnamespce between container
  • How to support input Chinese (UTF-8) in boot2docker(tiny core) /bin/sh (shell)
  • Unable to access docker container from the port mapped by docker
  • 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.