PR Checks / checks (pull_request) Successful in 2m17s
Zampler is pure Go with CGO disabled (modernc.org/sqlite), so both
architectures cross-compile from the amd64 runner at native speed with
no emulation. The runtime Dockerfile has no RUN steps, so buildx can
assemble the arm64 image on the amd64 host without QEMU too.
- Cross-compile dist/zampler-linux-{amd64,arm64} in one job.
- Dockerfile copies dist/zampler-linux-${TARGETARCH}; buildx sets
TARGETARCH per platform leg.
- Replace `docker build`/`push` with a single `docker buildx build
--platform linux/amd64,linux/arm64 --push`, producing a manifest list
at :latest.
- Promote :latest to :previous with `buildx imagetools create`, which
copies the manifest list registry-side instead of pulling a single
arch and re-pushing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
17 lines
607 B
Docker
17 lines
607 B
Docker
# The zampler binaries are cross-compiled in CI (.gitea/workflows/build.yml) so
|
|
# the compile can use a persistent Go module + build cache and avoid emulation.
|
|
# This image is just the runtime wrapper around the prebuilt static binary;
|
|
# buildx sets TARGETARCH per platform and we copy the matching binary.
|
|
#
|
|
# For a local build:
|
|
# GOOS=linux GOARCH=amd64 go build -o dist/zampler-linux-amd64 .
|
|
# docker build --build-arg TARGETARCH=amd64 .
|
|
|
|
FROM alpine:3.24
|
|
|
|
ARG TARGETARCH
|
|
COPY dist/zampler-linux-${TARGETARCH} /usr/local/bin/zampler
|
|
|
|
ENTRYPOINT ["zampler"]
|
|
CMD ["-s", "/db/zampler.sqlite3", "/data"]
|