glab artifact-registry Docker login and credential helper resolution
Introduced 2026-08-18 · score 0.98
HOW TO USE IT
When authenticating Docker to a GitLab Artifact Registry, register glab as its credential helper with `glab artifact-registry login --docker --registry <registry_host>`. The helper exchanges a fresh token for each pull or push and ignores `GITLAB_TOKEN`.
glab artifact-registry login --docker --registry <registry_host>WHY THIS HELPS
Authenticate Docker to a GitLab artifact registry and resolve registry credentials through Docker's credential helper.
REQUIREMENTS AND LIMITATIONS
- Version: v1.114.0
- --docker (required): Selects Docker configuration; registers glab as a Docker credential helper. Writes to `$DOCKER_CONFIG`, or `~/.docker` if unset.
- --registry <registry_host> (required): Registry to authenticate against. For Docker, provide a bare hostname; use only a registry backed by Artifact Registry.
- --duration: Sets exchanged token lifetime for other package managers; ignored for Docker.
- --hostname: GitLab hostname to request the token from; defaults to the configured GitLab instance.
- Prerequisite: Run `glab auth login` first if no credential is stored for the GitLab host. The Docker helper reads credentials from the configuration file and ignores `GITLAB_TOKEN`.
- Docs conflict: Current GitLab Artifact Registry Docker documentation says the GitLab CLI version must be 1.115.0 or later, newer than the card’s v1.114.0. That page does not establish this prerequisite for v1.114.0: https://docs.gitlab.com/artifact-registry/formats/docker/
FIRST-PARTY EVIDENCE
- https://gitlab.com/gitlab-org/cli/-/releases/v1.114.0
- https://docs.gitlab.com/cli/artifact-registry/login/
Check the installed version and the source before using it. Entry JSON