Registry Configuration
Embedded registry#
The mock server embeds an OCI registry that shares the mock container’s internal port, auto-configured with CI_REGISTRY_* variables. docker build/docker push against $CI_REGISTRY work out of the box.
The registry data lives on a Docker volume named glci-registry-<hash>, where the hash identifies the GLCI_HOME of the daemon that owns it, so it persists across daemon restarts and daemons with different homes do not share it. glci registry clean removes it even with the daemon stopped (see the command reference).
Managing the registry#
# List images stored locally
glci registry list
# List images for a specific project
glci registry list --project group/myproject
# Show storage statistics
glci registry stats
# Pull an image from the local registry into Docker
glci registry pull registry.gitlab.com/group/project/app:latest
# Pull and retag with a prefix
glci registry pull registry.gitlab.com/group/project/app:latest local
# Clean up stored registry blobs
glci registry clean
# Clean only a specific project's images
glci registry clean --project group/myproject
Disabling or replacing the registry#
Disable the embedded registry with --no-registry, or point to an external registry:
glci run --no-registry
glci run --registry registry.gitlab.com --registry-user my-user --registry-password my-token
The external registry can also be configured in ~/.glci/config.toml (global config only):
[registry]
url = "registry.gitlab.com"
username = "my-user"
password = "$REGISTRY_PASSWORD" # env var reference supported
Pull-through cache#
The embedded registry acts as a read-through cache for a configurable list of upstream registries (defaults to registry.gitlab.com,registry-1.docker.io). Manifest/blob GETs that miss locally are fetched from the first upstream that has them, cached in the volume, and served – so repeat pulls stay on localhost after the first fetch.
This is especially useful for DinD pipelines: the DinD daemon inside each pipeline is automatically configured as a pull-through mirror of the embedded registry, so even docker pull inside DinD benefits from the local cache.
Set the list with [images] upstreams in ~/.glci/config.toml:
[images]
upstreams = ["proxy.corp.internal"]
When set, the list is exhaustive — it replaces the default rather than adding to it, including the GitLab registry host. See The images glci pulls for itself.
Credentials go only to a token realm on the upstream’s own domain; a realm elsewhere gets an anonymous token request. An upstream cannot redirect the proxy to a loopback or link-local address. A mirror on a private network works as normal. See Pull-through security.
Push-through mirror#
Optionally mirror every image your pipeline pushes to CI_REGISTRY onward to the upstream registry (usually registry.gitlab.com).
Enable globally:
# ~/.glci/config.toml
[registry]
push_through = true
[registry.upstream]
username = "deploy-token"
password = "$REGISTRY_WRITE_TOKEN" # env var reference
Or per-run:
glci run --push-through
push_through = true applies to every run: glci run, runs started from the TUI, and glci retry. --push-through exists only on glci run, and a retry does not replay it.
Semantics:
- Fires synchronously as part of each manifest
PUT— upstream failures surface as 5xx todocker push - Scoped to the current project — other projects are not mirrored
- Idempotent via upstream HEAD probes
- Credentials need
write_registryscope
TLS and insecure registries#
The embedded registry serves plain HTTP from the mock server’s container. glci generates no TLS certificate for it and mounts no CA certificate into containers; instead it marks the registry as insecure for each client that would otherwise insist on HTTPS:
- Injects a
daemon.jsonlisting the mock registry underinsecure-registriesfor DinD’sdockerd - Injects a
buildkitd.tomlmarking the mock registry as HTTP and insecure for buildx builders
There is nothing to configure. The [tls] section and the registry [network]/[paths] keys older versions documented never had an effect — see Removed keys. See TLS and trust for how each kind of container reaches the registry.
Docker Hub authentication#
Host Docker credentials from ~/.docker/config.json are automatically merged into each job’s DOCKER_AUTH_CONFIG environment variable. This means authenticated Docker Hub rate limits apply (200 pulls/6h free, unlimited paid) instead of the anonymous 100/6h limit:
docker login
glci run