flightlesssomething/Dockerfile

15 lines
484 B
Docker
Raw Permalink Normal View History

2024-07-04 22:29:32 +02:00
FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG version
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GOARM=${TARGETVARIANT#v} go build -a -ldflags "-w -s -X main.version=$version -extldflags '-static'" -o fm ./cmd/flightlesssomething/main.go
2024-08-05 11:25:11 +02:00
FROM --platform=$BUILDPLATFORM gcr.io/distroless/static
2024-07-04 22:29:32 +02:00
COPY --from=builder /app/fm /fm
ENTRYPOINT ["/fm"]