Troubles pulling from a private DockerHub repo with Windows runner
I’ve been able to successfully run my gitlab-ci pipeline when my DockerHub repo was public - but not so much since i’ve switched the repo to private.
The pipeline error i’m receiving:
Running with gitlab-runner 12.7.0 (58272c27)
on multi-purpose mnyax9cs
Using Docker executor with image my_private_repo_name/project:tag ...
Pulling docker image my_private_repo_name/project:tag ...
ERROR: Job failed: Error response from daemon: pull access denied for my_private_repo_name/project, repository does not exist or may require 'docker login': denied: requested access to the resource is denied (executor_docker.go:188:0s)
From the error message it appears to be an authentication to dockerhub issue or I’m not fully qualifying the location of my dockerhub repo now that it’s private or maybe i’m missing a port number.
My environment:
- GitLab ee 12.7.0 on Ubuntu 18.04
- Runner host machine is running Win 1809
- gitlab-runner.exe installed as a serivce - docker-windows executor - runner version 12.7.0
- Docker Desktop for Windows installed [v 2.2.0.0 (42247)]
My gitlab-ci.yml:
image: my_private_repo_name/project:tag
test:
artifacts:
paths:
- c:\builds\username\nghello_world_node\dist\
script:
# Check for NPM updates
- npm -g install npm
# Install Node dependencies
- npm install
# Compile Angular Code
- npm run build
Things I’ve tried thus far:
-
Following these instructions to add a DOCKER_AUTH_CONFIG variable to the runner’s config.toml file:
[[runners]] environment = ["DOCKER_AUTH_CONFIG={\"auths\":{\"my_private_repo_name/project\":{\"auth\":\"base64_username:password_string\"}}}"]
Where base64_username:password_string is a base64 encoding of my dockerhub “username:password” - using this section of gitlab documentation.
- I’ve tried adding a DOCKER_AUTH_CONFIG variable to my project’s CI/CD settings (gitlab project>Settings>CI/CD>Variables - following these instructions to create a docker config.json file and add the contents of this file as a variable.
Value:
{
"auths": {
"my_private_repo_name/project": {
"auth": "(base64_username:password_string)"
}
}
}
- I’ve also tried referencing the private DockerHub repo more specifically/more uniquely when specifying the private repo location - for instance, the image value in gitlab-ci.yml file:
image: https://hub.docker.com/repository/docker/my_private_repo_name/project:tag
or
image: registry.hub.docker.com/my_private_repo_name/project:tag
I’ve also tried adjusting the same repo location in the runner’s config.toml and in the DOCKER_AUTH_CONFIG variable I configured - all to no avail.
I’m wondering if anyone else has run into this issue or has noticed anything that i’m missing.
Any insight is much appreciated!