Skip to content

feat(release): publish a multi-arch Docker image to ghcr.io - #26

Merged
NikitaMikhailov merged 1 commit into
mainfrom
feat/docker-image
Sep 9, 2026
Merged

NikitaMikhailov merged 1 commit into
mainfrom
feat/docker-image

Conversation

@NikitaMikhailov

Copy link
Copy Markdown
Owner

Summary

Adds a linux/amd64+linux/arm64 Docker image, published to ghcr.io/nikitamikhailov/dashsync on every release, via GoReleaser's dockers_v2 (not the older dockers/docker_manifests, already deprecated as of the pinned 2.18.1). Alpine-based with ca-certificates and openssh-client so every address scheme this project supports (tcp://+TLS, ssh://) actually works inside the container.

Two things found in review, fixed before merging — see docs/decisions/010:

  • Multi-platform buildx needs QEMU + a real multi-platform builder, neither pre-installed on a bare GitHub Actions runner (Docker Desktop bundles both, which is why this worked untouched in local testing and would not have worked on the first real tag push). Both release.yml and a new ci.yml job now set these up explicitly.
  • The full snapshot build check got its own ci.yml job, not folded into lint — a heavier, differently-scoped check that shouldn't muddy what a red "lint" status means.

Also: alpine pinned by digest (with a new dependabot.yml docker ecosystem entry to keep it bumped), and the Dockerfile documents why it deliberately runs as root (docker.sock access needs root-equivalent privilege regardless of container UID).

Test plan

  • Verified locally against a real Docker socket (inspect against a mounted /var/run/docker.sock) and a real SSH-reachable host (ssh:// case — found and documented that it also needs known_hosts mounted and the agent forwarded, not just the config file).
  • Reviewer subagent pass found the QEMU/buildx gap and the lint-job scoping issue; both fixed.
  • This PR itself is the real test of the QEMU/buildx fix — the new docker-build-check CI job runs the exact multi-arch buildx build on a bare ubuntu-latest runner, which local Docker Desktop testing couldn't validate (it bundles QEMU/buildx automatically, masking exactly this gap).
  • go build/go test ./... -race/golangci-lint run/goreleaser check all clean (no Go source touched).

Adds a linux/amd64+linux/arm64 image via GoReleaser's dockers_v2 (not
the older dockers/docker_manifests, already deprecated as of the pinned
2.18.1), alpine-based with ca-certificates and openssh-client so every
address scheme this project supports (tcp+tls, ssh://) actually works
inside the container, not just the ones that need nothing extra.

Two things found in review and fixed before merging:
- dockers_v2's multi-platform buildx build needs a builder that actually
  supports multi-platform output plus QEMU to emulate the non-native
  arch. Docker Desktop bundles both automatically, which is why this
  worked untouched in local testing and would NOT have worked the first
  time a real tag reached a bare GitHub Actions runner. Both release.yml
  and the new ci.yml docker check job now run docker/setup-qemu-action
  and docker/setup-buildx-action first -- GoReleaser's own documented
  prerequisite for this on Linux.
- The full snapshot build moved into its own ci.yml job rather than
  being folded into the existing lint job -- a heavier, differently-
  scoped check than golangci-lint/go mod tidy/goreleaser check, and
  keeping it separate means a red "lint" status still means what it's
  always meant.

Also: the alpine base is pinned by digest (dependabot.yml gained a
docker ecosystem entry to keep it bumped), and the Dockerfile documents
why it deliberately doesn't drop to a non-root USER (docker.sock access
needs root-equivalent privilege regardless of container UID).

See docs/decisions/010-docker-image.md, including two things verified
by actually running them: the socket-mount case against a real local
Docker socket, and the ssh:// case against a real SSH-reachable host
(needs known_hosts mounted and the agent forwarded, not just the config
file -- confirmed by hitting "Host key verification failed" first).
@NikitaMikhailov
NikitaMikhailov merged commit e49fa2b into main Sep 9, 2026
10 checks passed
@NikitaMikhailov
NikitaMikhailov deleted the feat/docker-image branch September 9, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant