feat: add docker_auth top-level block for host registry login#1
Merged
Conversation
Declares which container registries the host docker daemon should be authenticated to. On `up`, runs `dokku registry:login <server> <user> <password>` for each entry. Idempotent — docker overwrites the entry on subsequent runs. Use case: deploying via `dokku git:from-image` against a private registry (e.g. ghcr.io). Without prior login the daemon can't pull, so the deploy fails. Today operators must SSH in and run the login manually; this brings it into the same idempotent config-application pipeline as plugins, networks, etc. Distinct from the per-app `apps.<app>.registry:` block, which sets `registry:set` properties (push destinations, image-build behavior). Naming chosen to make that distinction obvious. Includes a small extension to `maskSensitiveArgs` to redact the positional password in `registry:login` commands during `--dry-run` output (the existing regex only matches KEY=VALUE pairs). Removal: dropping a server from `docker_auth:` does NOT auto-logout — host credential state persists. Same posture as `plugins:`. Documented. Sized at ~80 LOC including tests and reference docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Declares which container registries the host docker daemon should be authenticated to. On `up`, runs `dokku registry:login ` for each entry. Idempotent — docker overwrites the credential on subsequent runs.
```yaml
docker_auth:
ghcr.io:
username: "${GHCR_USERNAME}"
password: "${GHCR_PAT}"
```
Why
We're moving CI builds for some apps off the prod dokku host (heavy Vite + openapi-ts builds were saturating the box and causing Cloudflare Tunnel 502s during deploy). The new flow builds on GHA, pushes to private GHCR, and uses `dokku git:from-image` on the host to pull and swap.
For `git:from-image` to work, the host docker daemon needs to be authenticated to GHCR. Today that's a one-time `dokku registry:login` SSHed in manually. This brings it into the declarative config-application pipeline alongside `plugins:`, `networks:`, etc., so:
Naming
Top-level key is `docker_auth:` rather than `registry_logins:` to avoid confusion with the existing per-app `apps..registry:` block. That one maps to `dokku registry:set` (per-app push behavior) — a different surface.
Implementation notes
Decisions called out
Test coverage
```
212 pass / 0 fail (was 200 before — 12 new assertions across 3 new test files)
```
Diff size
12 files, +183 / -2.
Follow-up (downstream)
After release, the qlustr repo's `dokku-compose.{production,staging}.yml` will be updated to include a `docker_auth:` block with `op://` references for the GHCR PAT. The manual `dokku registry:login` step in the qultr CI rollout PR's pre-merge checklist becomes redundant once that lands.