Skip to content

Ignore DOCKER_AUTH_CONFIG without opt-in on Gitlab CI #6171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vvoland
Copy link
Collaborator

@vvoland vvoland commented Jul 9, 2025

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)

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`

```json ~/.docker/config.json
{
    ...,
    "features": {
        "auth_config_order": "config,env"
    }
}
```

Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added this to the 28.3.2 milestone Jul 9, 2025
@vvoland vvoland self-assigned this Jul 9, 2025
@codecov-commenter
Copy link

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 ⚠️
cli/command/registry/logout.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@vvoland vvoland requested a review from Benehiko July 9, 2025 14:54
@vvoland vvoland modified the milestones: 28.3.2, 28.3.3 Jul 9, 2025
@thaJeztah thaJeztah modified the milestones: 28.3.3, 29.0.0 Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants