2023-07-13 19:37:38 +00:00
|
|
|
FROM golang:1.19-alpine3.18 AS builder
|
2020-10-14 23:35:59 +00:00
|
|
|
|
2020-10-16 00:01:05 +00:00
|
|
|
ENV GO111MODULE=on \
|
|
|
|
CGO_ENABLED=0 \
|
|
|
|
GOOS=linux \
|
|
|
|
GOARCH=amd64 \
|
|
|
|
GOBIN=/dist
|
|
|
|
|
2020-10-14 23:35:59 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2023-07-13 19:37:38 +00:00
|
|
|
RUN go install -ldflags="-w -s" .
|
2020-10-15 01:17:09 +00:00
|
|
|
|
2023-07-13 19:37:38 +00:00
|
|
|
FROM alpine:3.18
|
2020-10-21 00:19:54 +00:00
|
|
|
|
|
|
|
RUN apk --no-cache add fio
|
2020-10-15 01:17:09 +00:00
|
|
|
|
2020-10-16 00:01:05 +00:00
|
|
|
COPY --from=builder /dist/kubestr /
|
2020-10-14 23:35:59 +00:00
|
|
|
|
2020-10-16 00:01:05 +00:00
|
|
|
ENTRYPOINT ["/kubestr"]
|