ci: add Dockerfile and GHCR multi-arch publish workflow

This commit is contained in:
tiennm99 committed 2026-05-08 23:46:35 +07:00
1 parent e18d271970
commit d3ba1a3761
3 files changed
+101

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# syntax=docker/dockerfile:1.7
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS build
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -trimpath -ldflags="-s -w" -o /out/app .
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/app /app
ENTRYPOINT ["/app"]