Bravi
Bravi

Reputation: 773

Auto pulling Docker container using Watchtower throws access denied when pulling from a private repo

I've got docker running on my DigitalOcean droplet and I'm trying to pull in images from my gitlab repository using watchtower. I'm using pass (sudo apt-get install pass) to manage the credentials and here is my config.json file:

{
        "auths": {
                "registry.gitlab.com": {}
        },
        "HttpHeaders": {
                "User-Agent": "Docker-Client/18.09.6 (linux)"
        },
        "credsStore": "pass",
        "credHelpers": {
                "registry.gitlab.com": "pass"
        }

I'm getting the following errors when I look at watchtower logs:

watchtower    | time="2020-10-16T14:24:36Z" level=debug msg="Pulling registry.gitlab.com/myuser/myrepo/image:latest for /image"
watchtower    | time="2020-10-16T14:24:36Z" level=debug msg="Loaded auth credentials for user , on registry registry.gitlab.com/myuser/myrepo/image:latest, from file /config.json"
watchtower    | time="2020-10-16T14:24:36Z" level=debug msg="Got image name: registry.gitlab.com/myuser/myrepo/image:latest"
watchtower    | time="2020-10-16T14:24:36Z" level=debug msg="Error pulling image registry.gitlab.com/myuser/myrepo/image:latest, Error response from daemon: Get https://registry.gitlab.com/v2/myuser/myrepo/image/manifests/latest: denied: access forbidden"

This is my watchtower config for docker-compose:

  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ~/.docker/config.json:/config.json
    command: --interval 30 --cleanup

Something strange I noticed in those logs is this bit: Loaded auth credentials for user ,. It's almost as if it cannot read some sort of a user.

Upvotes: 1

Views: 1657

Answers (0)

Related Questions