A statically linked Go binary in a scratch image — a few megabytes, instant boot, negligible memory. Built for Ampere A1 (arm64), listens on port 8080, and starts with ./server.
FROM golang:1.23-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o /out/server ./cmd/server
FROM gcr.io/distroless/static-debian12
COPY --from=build /out/server /server
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/server"]Go cross-compiles to arm64 natively and CGO_ENABLED=0 gives a fully static binary — the resulting image is often under 15 MB, the fastest thing you can deploy on an Ampere instance.
Cheaploy builds this image on your own Oracle Always Free VM, opens the ports, issues HTTPS and rolls back if health checks fail.