Skip to content

doc: go container release process#83

Merged
frrist merged 2 commits intomainfrom
frrist/rfc/container-release-process
Mar 10, 2026
Merged

doc: go container release process#83
frrist merged 2 commits intomainfrom
frrist/rfc/container-release-process

Conversation

@frrist
Copy link
Copy Markdown
Member

@frrist frrist commented Mar 2, 2026

Copy link
Copy Markdown
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

LGTM - left some suggestions.

Comment thread rfc/container-release-process.md Outdated
Comment thread rfc/container-release-process.md Outdated
Comment thread rfc/container-release-process.md Outdated

### Pull Requests

PR builds should validate that the Dockerfile compiles but need not push images anywhere. Building on a single platform (amd64) is sufficient here — the goal is fast feedback, not architectural completeness.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there any chance that building for a different arch could fail? My guess is no, or at least very unlikely, but if we're concerned then we should probably build on both.


## CI/CD Considerations

The workflow should live at `.github/workflows/publish-ghcr.yml` and be named `Container`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Include a template?

Copy link
Copy Markdown

@volmedo volmedo left a comment

Choose a reason for hiding this comment

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

Looks good overall. I left some suggestions.

Comment thread rfc/container-release-process.md Outdated
The production target should be small, fast, and boring:

- Stripped binary (`-ldflags="-s -w"`)
- Minimal base image (`debian:bookworm-slim`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For Go I'd go with scratch for a really minimal image with the smallest attack surface possible. The caveat is that scratch has nothing in it, so it requires copying CA certificates from the builder image (we currently do this in our services deployed via storoku), and setting a non-root image up is a bit more involved.

Alternatively, gcr.io/distroless/static could be a good middle ground, as it is small but comes with CA certificates and a non-root user pre-baked in the image.

Of course, both alternatives work only for statically-linked binaries. But that is what we are doing currently.

Copy link
Copy Markdown
Member Author

@frrist frrist Mar 10, 2026

Choose a reason for hiding this comment

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

Incorporated with a twist. The RFC now standardizes on alpine:latest as the single base image — it's ~5MB, includes wget and CA certificates, and provides a shell for Docker Compose healthchecks as well as entry point scripts which Piri and IPNI require.

Comment thread rfc/container-release-process.md Outdated

- Stripped binary (`-ldflags="-s -w"`)
- Minimal base image (`debian:bookworm-slim`)
- Only what's needed to run and health-check: `ca-certificates`, `curl`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To run a healthcheck on a different service? Having curl installed in a prod image it's an uncommon requirement IMO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Standardizing on wget instead which we get for free via #83 (comment)


The precise selection of debugging tools is a matter of taste. The principle is not: include everything that may be required.

### Non-root user
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❤️

Comment thread rfc/container-release-process.md Outdated

The key insight: `$BUILDPLATFORM` is the CI runner's architecture (x86_64), and `$TARGETPLATFORM` is the final image's architecture. Go handles cross-compilation natively, so the compiler runs fast while producing binaries for whatever architecture you need.

QEMU remains necessary for the runtime stages, where `apt-get` and friends must execute on the target architecture. These operations are lightweight compared to compilation, so the tradeoff is favorable.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoiding the RUN command would also avoid the need of emulation completely. CA certificates can be installed in the builder and copied over to the runtime image (or use an image that comes with them pre-installed, such as distroless/static). Getting curl would be trickier though, but I'm not sure that should be a requirement.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

switching to alpine:latest should address this. Sorry was over complicating things here.

Comment thread rfc/container-release-process.md Outdated
Comment on lines +40 to +41
| `<sha>` | prod | No | Specific commit (production build) |
| `<sha>-dev` | dev | No | Specific commit (dev build) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are short SHAs, correct? Might be worth making it explicit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yea, now explicitly stated

@frrist frrist merged commit 99f2e77 into main Mar 10, 2026
@frrist frrist deleted the frrist/rfc/container-release-process branch March 10, 2026 21:00
Peeja added a commit to storacha/guppy that referenced this pull request Apr 6, 2026
Add docker container release process
Follows outline proposed in storacha/RFC#83

Co-authored-by: Petra Jaros <peeja@peeja.com>
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.

3 participants