Automatically authenticate with the Dependency Proxy
Description
Runner already automatically authenticates with the integrated GitLab container registry. We are introducing authentication to the Dependency Proxy, which means that to use the dependency proxy, a user must add their credentials to the DOCKER_AUTH_CONFIG
environment variable or manually docker login
somewhere in their CI script.
Proposal
Allow runners to automatically authenticate with the dependency proxy. I believe credentials for the GitLab container registry and DOCKER_AUTH_CONFIG
are handled in this section of code. It's likely we could also use the exact same credentials we are using for the GitLab container registry.
The server that needs to be added is simply the GitLab host.
I'm not sure how we handle this authentication, but if we are editing the config file, we would need to add gitlab.com
to the auths
list:
{
"auths": {
"https://gitlab.com": {
"auth": "(Base64 username:password value)"
}
}
}
If we are executing a login command, we would need to log in to gitlab.com
:
docker login --username foo --password bar gitlab.com