From 1ededfd6eb40a5294fbe794a5fb26cb3f3609107 Mon Sep 17 00:00:00 2001 From: Nedunchezhiyan-M Date: Fri, 17 Apr 2026 19:22:16 +0530 Subject: [PATCH] build: note that GIT_AUTH_TOKEN is incompatible with GitLab CI_JOB_TOKEN GitLab CI job tokens require Basic authentication with the username gitlab-ci-token, but BuildKit always uses x-access-token as the username for Basic auth. This makes GIT_AUTH_TOKEN and GIT_AUTH_HEADER unusable with CI_JOB_TOKEN. Users must use a Personal Access Token. Fixes #22834 --- content/manuals/build/building/secrets.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/manuals/build/building/secrets.md b/content/manuals/build/building/secrets.md index eb0856aeef..7907aee212 100644 --- a/content/manuals/build/building/secrets.md +++ b/content/manuals/build/building/secrets.md @@ -194,6 +194,13 @@ To authenticate the builder to the Git server, set the `GIT_AUTH_TOKEN` environment variable to contain a valid GitLab access token, and pass it as a secret to the build: +> [!NOTE] +> +> `GIT_AUTH_TOKEN` and `GIT_AUTH_HEADER` are not compatible with GitLab's +> `CI_JOB_TOKEN`. GitLab CI job tokens require Basic authentication with the +> username `gitlab-ci-token`, but BuildKit always uses `x-access-token` as the +> username for Basic auth. Use a Personal Access Token instead. + ```console $ GIT_AUTH_TOKEN=$(cat gitlab-token.txt) docker build \ --secret id=GIT_AUTH_TOKEN \