cli icon indicating copy to clipboard operation
cli copied to clipboard

Ignore `DOCKER_AUTH_CONFIG` without opt-in on Gitlab CI

Open vvoland opened this issue 7 months ago • 1 comments

This is a hot-fix that prevents using the DOCKER_AUTH_CONFIG env-var as a credential helper when running in Gitlab CI (determined by GITLAB_CI environment variable).

An explicit setting controlling this behavior is available through the auth_config_order feature flag in the Docker CLI config (and DOCKER_AUTH_ORDER environment variable that takes precedence over the feature flag value).

It accepts a comma separated "config" and "env" strings which determine the order.

Currently, possible values are:

  • "config,env" - prefer the auth from config.json first
  • "env,config" - prefer the auth from DOCKER_AUTH_CONFIG
{
    ...,
    "features": {
        "auth_config_order": "config,env"
    }
}

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Temporarily disable `DOCKER_AUTH_CONFIG` taking precedence on Gitlab CI by default. The behavior can be explicitly defined with `DOCKER_AUTH_ORDER=env,config` or `~/.docker/config.json` feature flag: `{ ..., "features": { "auth_config_order": "env,config" } }`

- A picture of a cute animal (not mandatory but encouraged)

vvoland avatar Jul 09 '25 14:07 vvoland

Codecov Report

Attention: Patch coverage is 85.96491% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/config/configfile/file.go 83.33% 4 Missing and 1 partial :warning:
cli/command/registry/logout.go 0.00% 3 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov-commenter avatar Jul 09 '25 14:07 codecov-commenter