🤖 ci: add OCI image labels and Apache-2.0 license#57
Merged
Conversation
Add standard OCI image labels to publish-time image builds so release images and ghcr.io/coder/coder-k8s:main carry source, version/revision, build time, and licensing metadata. Also add an Apache-2.0 LICENSE file and document license information in the README. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.94`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.94 -->
Member
Author
|
@codex review Please review this PR for OCI label metadata and licensing changes. |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Member
Author
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
This PR adds standard OCI image metadata labels to publish-time container images and introduces an explicit Apache-2.0 repository license.
Background
Published images should expose canonical source/version/license metadata for registries and supply-chain tooling. The repository also needed an explicit license file and matching image license annotation.
Implementation
Validation
Risks
Low. Changes are limited to release/publish metadata and licensing/docs. Runtime controller behavior is unchanged.
📋 Implementation Plan
Plan: Add OCI image labels + Apache-2.0 license
Context / Why
We want
coder-k8simages published to GHCR to include standard OCI image annotations (surfaced as Docker image labels) so registries and supply-chain tooling can reliably show:org.opencontainers.image.source)…version,…revision)…created)…title,…description,…documentation, etc.)Additionally, we want the repository to be explicitly licensed by adding an Apache-2.0
LICENSEfile, and to reflect that license in image metadata (org.opencontainers.image.licenses=Apache-2.0).User decisions (2026-02-12):
:mainpublish). Keep e2e/kind/localdocker buildimages unchanged.Evidence
Dockerfile.goreleaserhas noLABELinstructions (so adding labels must be done via build flags for the selected scope)..goreleaser.yamlusesdockers[].build_flag_templates, which supports passing--label=…at build time..github/workflows/ci.yamlpublishesghcr.io/coder/coder-k8s:mainviadocker/build-push-actionbut currently provides no labels.org.opencontainers.image.*):opencontainers/image-specannotations.md..Dateis UTC RFC3339 and.FullCommit/.Versionare available template keys.Implementation details
1) Add Apache-2.0
LICENSEFiles:
LICENSE(new)Steps:
LICENSEfile containing the canonical Apache License, Version 2.0 text.README.mdlike## License→Apache-2.0.Notes:
Apache-2.0.NOTICEis only necessary if we want to carry additional attribution notices; defer unless we have a concrete need.2) Add OCI labels to release images built by GoReleaser
File:
.goreleaser.yamlApproach:
Add OCI labels as Docker
--label=…flags in the existingdockers[0].build_flag_templateslist.Proposed label set (OCI pre-defined keys):
org.opencontainers.image.created= build time (RFC3339)org.opencontainers.image.source= repo URLorg.opencontainers.image.url= project homepage URL (docs site)org.opencontainers.image.documentation= docs URLorg.opencontainers.image.title=coder-k8sorg.opencontainers.image.description= short human descriptionorg.opencontainers.image.version= release versionorg.opencontainers.image.revision= git commit SHAorg.opencontainers.image.vendor=Coderorg.opencontainers.image.licenses=Apache-2.0org.opencontainers.image.authors=Coder(orCoder <support@coder.com>if preferred)Config sketch:
Deliberate omissions:
org.opencontainers.image.ref.name(OCI spec says it’s only meaningful for OCI image layout descriptors).org.opencontainers.image.base.*(requires pinning + reliably discovering base digest; out of scope for now).3) Add OCI labels to GH Actions publish
:mainimageFile:
.github/workflows/ci.yamlApproach:
run:step inpublish-mainto compute an RFC3339 UTC timestamp.labels:block todocker/build-push-action.Workflow sketch:
This keeps the label scope tightly limited to published images (release +
:main) without adding labels to the Dockerfile that would also affect e2e/kind/local builds.4) Validation / roll-out
make testmake buildmake lintgo tool actionlintFor the GH Actions
:mainlabel set, run a local build with equivalent--labelflags (copied from the workflow) and inspect:For GoReleaser-built (release) images:
goreleaser release --snapshot --clean(snapshot mode implies no publishing)docker inspect …(GoReleaser will print the image tags it built).Notes / future enhancements (not in scope)
org.opencontainers.image.base.name/…base.digestafter pinning the distroless base image to a digest.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.94