mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-01-25 23:03:57 +00:00
26 lines
599 B
Docker
26 lines
599 B
Docker
FROM golang:1.20.3-alpine3.16 AS builder
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
WORKDIR /workspace
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY ./ ./
|
|
|
|
RUN go build -o /workspace/k8sgpt ./
|
|
|
|
FROM gcr.io/distroless/static AS production
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/k8sgpt-ai/k8sgpt" \
|
|
org.opencontainers.image.url="https://k8sgpt.ai" \
|
|
org.opencontainers.image.title="k8sgpt" \
|
|
org.opencontainers.image.vendor="the k8sgpt-ai maintainers" \
|
|
org.opencontainers.image.licenses="MIT"
|
|
|
|
WORKDIR /
|
|
COPY --from=builder /workspace/k8sgpt .
|
|
USER 65532:65532
|
|
|
|
ENTRYPOINT ["/k8sgpt"] |