Cannot use private images from Docker Hub (with Swarm)

I have added Docker hub as a registry, in my compose file I refer to the image i want as:

dockerhubusername/imagename:latest

This always gives “image not found” when deploying my project.

I have tried:

  • Prefixing my image with docker/, docker.io/, dockerhub/, index.docker.io/ - does not work
  • Making my image public - works
  • Running docker login from swarm cli - works

Any idea on how to troubleshoot or fix this?

Have you looked at the docs on registries?

http://docs.rancher.com/rancher/v1.2/en/environments/registries/#adding-registries

Yes I have. It works with Cattle, but not with Swarm.