mirror of
https://github.com/kastenhq/kubestr.git
synced 2024-12-14 11:57:56 +00:00
dc406614dc
* multi-platform kubestr image * Adjusting Dockerfile to do a native compile + emulated image build * remove explicit TARGETPLATFORM
31 lines
453 B
Docker
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"]
|