Skip to content

feat(offload): add darwin and windows static archives - #603

Merged
crazy-max merged 1 commit into
docker:mainfrom
nicksieger:offload-static-mac-windows
Nov 20, 2026
Merged

crazy-max merged 1 commit into
docker:mainfrom
nicksieger:offload-static-mac-windows

Conversation

@nicksieger

@nicksieger nicksieger commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add static archives for the Offload plugin on darwin, windows and linux (amd64, arm64): a .tgz for macOS and Linux and a .zip for Windows, each with a .sha256 file, at static/<os>/<arch>/docker-offload-plugin_<version>.{tgz,zip}.
  • Add darwin/* and windows/* to PKG_PLATFORMS_BASE.offload.
  • Remove offload from PKG_DISTROS, so Offload builds for every distro in DISTROS, including static.
  • The archive layout is the one from static: Simplify archive directory layout #571: cli-plugins/docker-offload[.exe] and doc/{LICENSE,README.md} at the top level, with no <pkgname>/ prefix.
  • verify-offload-static checks each archive: checksum, layout, that the binary matches the platform in its path and contains the version. It runs the plugin only for an archive that matches the verify container's platform (linux). Signatures are not checked.

The static stage compiles from source

Like the deb and rpm packages, builder-static compiles from source: it uses the Go toolchain, the build-env secret and the VERSION, COMMIT, BUILD and DATE args, and runs make ce-release under xx-go --wrap. It checks the result with xx-verify --static and archives it. It gets its Go toolchain from a go-build stage on the build platform, because the golang image has no darwin or windows variant.

The archives contain unsigned binaries on every platform. The darwin binaries are not signed or notarized, and the Windows binaries are not signed. Signing, if needed, has to happen outside this repo, after the archive is built.

Notes

  • doc/LICENSE and doc/README.md are copied from the src named context, and the build fails if either is missing.
  • Static builds every platform of the package, so pkg-offload-static also produces linux .tgz archives, and release-offload now lists all six platforms. Callers can pick platforms with --set <target>.platform=.... The deb and rpm targets still build only the platforms their distros support.
  • release-offload copies sbom-build*.json and provenance.json for each platform directory it picks up, so static builds need attestations enabled, as for deb and rpm.

🤖 Generated with Claude Code

@nicksieger
nicksieger requested a review from a team as a code owner November 19, 2026 17:05
Comment thread pkg/offload/verify.Dockerfile Resolved

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.

🟡 Changes recommended

The substring-based version check can accept a binary from a different release, allowing an incorrect Darwin or Windows binary to pass verification under the requested release name.

1 open issue
What changed in this PR

Adds Offload static archives to the packaging pipeline, wrapping prebuilt release binaries to preserve macOS and Windows signatures rather than compiling from source.

Changes:

  • Enables static packaging for macOS, Windows, and Linux on amd64 and arm64.
  • Creates archives with top-level cli-plugins and doc directories plus SHA-256 checksum files.
  • Adds checksum, layout, platform, and version checks, running the plugin only for matching container platforms.
File Description
pkg/​offload/​verify.Dockerfile Adds static archive verification.
pkg/​offload/​scripts/​pkg-static-build.sh Packages release binaries and documentation into archives with checksums.
pkg/​offload/​Dockerfile Adds the release-binary context and static packaging stage.
docker-bake.hcl Enables Offload static targets and expands supported platforms.

Review effort: Balanced

Comment thread pkg/offload/verify.Dockerfile Resolved
@nicksieger
nicksieger requested a review from vvoland November 19, 2026 23:03
Comment thread pkg/offload/scripts/pkg-static-build.sh Resolved
@nicksieger
nicksieger force-pushed the offload-static-mac-windows branch from 2f8df5a to 8547922 Compare November 20, 2026 16:43
@nicksieger
nicksieger marked this pull request as draft November 20, 2026 16:55
Comment thread pkg/offload/Dockerfile Resolved
@nicksieger
nicksieger force-pushed the offload-static-mac-windows branch from 8547922 to f00064e Compare November 20, 2026 17:21
@nicksieger
nicksieger marked this pull request as ready for review November 20, 2026 17:22
Comment thread docker-bake.hcl Resolved
Comment thread docker-bake.hcl Resolved
- static distro compiles from source with make ce-release under xx-go --wrap, as deb and rpm do
- archives the unsigned binary for every platform, no prebuilt release binaries
- tgz for darwin and linux, zip for windows, .sha256 next to each
- layout cli-plugins/ and doc/{LICENSE,README.md}, as merged in docker#571
- static stage gets the Go toolchain, build-env secret, COMMIT, BUILD and DATE
- verify-offload-static checks checksum, layout, platform and version
- build all distros + static
- add go-build stage on BUILDPLATFORM, golang has no darwin or windows image
- builder-static takes /usr/local/go from go-build instead of the target-platform go stage
- drop offload from PKG_DISTROS so it builds all DISTROS, including static
- restore the docker-bake.hcl copyright year

Signed-off-by: Nick Sieger <nick@nicksieger.com>
@nicksieger
nicksieger force-pushed the offload-static-mac-windows branch from f00064e to 735cbdb Compare November 20, 2026 19:15
@crazy-max
crazy-max merged commit 02e6ec2 into docker:main Nov 20, 2026
1485 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants