Skip to content

Add Dockerfile and GHCR publish workflow - #9

Open
rothgar wants to merge 1 commit into
tailscale:mainfrom
rothgar:feature/dockerfile
Open

rothgar wants to merge 1 commit into
tailscale:mainfrom
rothgar:feature/dockerfile

Conversation

@rothgar

@rothgar rothgar commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The workflow publishes ghcr.io/:latest on every push to main and proper semver tags (v1.2.3, 1.2, 1) on releases.

Copilot AI lite review requested due to automatic review settings August 13, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces containerization and automated publishing to GitHub Container Registry (GHCR) for ts-plug, enabling multi-arch (amd64/arm64) builds and CI-based image publishing.

Changes:

  • Add a multi-stage Dockerfile that builds a static ts-plug binary and ships it in a minimal Alpine runtime image.
  • Add a GitHub Actions workflow to build (and on non-PR events, push) the image to GHCR with metadata-driven tags/labels.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Dockerfile Multi-stage, multi-arch build producing a minimal Alpine runtime image with ts-plug entrypoint.
.github/workflows/build-image.yaml CI workflow to build/push the Docker image to GHCR and generate tags/labels via docker/metadata-action.
Suppressed comments (1)

.github/workflows/build-image.yaml:52

  • The computed tag set doesn’t match the workflow header comment/PR description:
  • type=ref,event=branch will publish an extra main tag on pushes to main.
  • There’s no tag rule that would publish v1.2.3 (as-is tag name).
  • latest is currently only enabled for the default branch, so it won’t be published for release/tag builds.
    Consider switching to type=ref,event=tag for the v* tag, and make latest unconditional (or otherwise enabled for tag/release runs) so the published tags match the stated intent.
          tags: |
            type=ref,event=branch
            type=ref,event=pr
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/build-image.yaml
Multi-arch Dockerfile: Go cross-compiles on BUILDPLATFORM (no QEMU) into a
static binary, alpine runtime stage.  ca-certificates are copied from the
builder rather than installed on the runtime stage so the target-arch
layer only has COPY instructions.

Workflow publishes to GHCR on:
  * push to main               -> latest, sha-<sha>
  * push of a v*.*.* tag       -> 1.2.3, 1.2, 1, sha-<sha>
  * pull request against main  -> build only, smoke test
  * manual workflow_dispatch   -> latest, sha-<sha>

latest tracks main by design; version tags land as their semver form
without the v prefix (docker/metadata-action default).

Signed-off-by: Justin Garrison <justinleegarrison@gmail.com>
@rothgar
rothgar force-pushed the feature/dockerfile branch from ad13ff0 to 41df43e Compare August 13, 2026 23:15
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.

2 participants