Skip to content

ci: push images to ghcr.io with new naming convention - #342

Draft
matifali wants to merge 2 commits into
mainfrom
matifali/ghcr-push
Draft

matifali wants to merge 2 commits into
mainfrom
matifali/ghcr-push

Conversation

@matifali

Copy link
Copy Markdown
Member

Summary

Publish images to GHCR as ghcr.io/coder/$DISTRO:$IMAGE (e.g. images/base/ubuntu.Dockerfile -> ghcr.io/coder/ubuntu:base). Docker Hub images keep being pushed unchanged for backwards compatibility, per the plan in #291.

Closes #291

Changes

  • scripts/push_images.sh: add --registry=dockerhub|ghcr.io (default dockerhub, unknown values rejected). GHCR pushes {image}, {image}-{date}, {image}-{version}, {image}-{version}-{date} tags, mirroring the Docker Hub tag variants (version from ubuntu_version_for, so universal gets -noble).
  • .github/workflows/build.yaml: add GHCR login (GITHUB_TOKEN) and push steps, non-PR events only. packages: write is scoped to the images job; the workflow default stays packages: none.
  • README.md: document GHCR naming and tags.

Validation

  • shellcheck, actionlint, dprint check pass.
  • Dry run with a stubbed depot and fake build metadata:
    • --registry=ghcr.io emits 36 tags (4 per image x 9 images), e.g. ghcr.io/coder/ubuntu:base-resolute-20260928, ghcr.io/coder/ubuntu:universal-noble.
    • Default Docker Hub output (90 pushes) is byte-identical to main.
    • --registry=quay.io exits with usage.

Note

The first push creates the ghcr.io/coder/ubuntu package. The org must allow GITHUB_TOKEN to create packages, and the package visibility needs to be set to public after the first run.

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

Add GHCR push support alongside existing Docker Hub push.
New naming: ghcr.io/coder/$TAG:$IMAGE (e.g., ghcr.io/coder/ubuntu:base).
Docker Hub images continue to be pushed for backwards compatibility.

Closes #291
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.

Rename images and push to ghcr.io

1 participant