watchtower: Non-standard image refs does not map to expected repositories in config.json

Describe the bug I am unable to pull private repositories with mapped config.json

Unable to update container "/grafana_importer": Error response from daemon: pull access denied for dockergelb/grafana-importer, repository does not exist or may require 'docker login

To Reproduce I have mapped the config.json in /root/.docker, to /config in the watchtower container, but it is still failing to pull private repositories, even though the same repos are accessible on the host system.

This is the docker-compose file I use, (.env just contains the notification variables):

version: "3.3"

services:
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /root/.docker/config.json:/config.json
    env_file: .env

Environment

  • Platform: Linux/Debian
  • Docker version: 20.10.2
  • Watchtower version: latest

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 24 (16 by maintainers)

Most upvoted comments

Hey @simskij, just to clarity as I’m facing the same issue. This should work:

  1. have you config file in the following format (generated using docker login): { "auths": { "https://index.docker.io/v1/": { "auth": "***********" } } }
  2. add the volume ${HOME}/.docker/config.json:/config.json
  3. add the fully qualified image name for your repo: docker.io/lsaadeh1/test:latest

It works when I manually copy my auth token for index.docker.io into a new entry for my username

...
"auths: {
    "dockergelb": {
        "auth": "*************************************"
    }
}