August 24, 2021

[SOLVED] local gitlab-runner exec docker with custom cntainer registry


In case your .gitlab-ci.yaml file has reference for custom docker registry and you get an error

ERROR: Preparation failed: failed to pull image "" with specified policies [always]: Error response from daemon: Get denied: access forbidden (manager.go:205:0s)

try to pass your auth key from ~/.docker/config.json file as follows. where AUTH_KEY is the key form this file for your domain 

gitlab-runner exec docker deploy:foo --env DOCKER_AUTH_CONFIG="{\"auths\":{\"\":{\"auth\":\"AUTH_KEY\"}}}"