glab(1)

NAME
glab-artifact-registry-login - Authenticate a package manager against the GitLab Artifact Registry. (EXPERIMENTAL)

SYNOPSIS
glab artifact-registry login [flags]

DESCRIPTION
Configure a package manager to authenticate against the GitLab Artifact Registry, using a short-lived access token exchanged from your GitLab session.

With --docker, glab is registered as a Docker credential helper for the registry, and Docker exchanges a fresh token on every pull or push, so --duration does not apply.

Use --registry only for a registry the Artifact Registry actually backs. The credential helper prefers the artifact registry token and falls back to container_registry_domains only when that exchange fails, so a container registry listed here gets an artifact registry token it rejects on every pull.

Docker runs that credential helper as its own subprocess, which reads your credentials from the configuration file and ignores GITLAB_TOKEN. This command verifies the login the same way, so run glab auth login first if no token is stored for the host.

This feature is an experiment and is not ready for production use. It might be unstable or removed at any time. For more information, see https://docs.gitlab.com/policy/development_stages_support/.

OPTIONS
--docker[=false]
    Configure Docker to authenticate against the registry. Writes to $DOCKER_CONFIG, or ~/.docker when it is unset.

--duration=0s
    How long the exchanged token should remain valid. Ignored for now: --docker is the only tool this command configures, and its credential helper mints a fresh token for every request.

--hostname=""
    GitLab hostname to request the token from. Defaults to the configured GitLab instance.

--registry=""
    Bare hostname of the registry to authenticate against.

OPTIONS INHERITED FROM PARENT COMMANDS
-h, --help[=false]
    Show help for this command.

EXAMPLE
    # Configure Docker to authenticate against a registry
    glab artifact-registry login --docker --registry registry.example.com

SEE ALSO
glab-artifact-registry(1)