1
0
Fork 0
mirror of https://github.com/kastenhq/kubestr.git synced 2024-12-14 11:57:56 +00:00
kastenhq-kubestr/Dockerfile
Sirish Bathina dc406614dc
Multi-platform kubestr image (#316)
* multi-platform kubestr image

* Adjusting Dockerfile to do a native compile + emulated image build

* remove explicit TARGETPLATFORM
2024-12-02 14:25:19 -10:00

31 lines
453 B
Docker

ARG BUILDPLATFROM
FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS builder
ARG TARGETOS
ARG TARGETARCH
ARG TARGETPLATFROM
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH}
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o /dist/kubestr -ldflags="-w -s" .
FROM alpine:3.19
RUN apk --no-cache add fio
COPY --from=builder /dist/kubestr /
ENTRYPOINT ["/kubestr"]