File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1- # Compile kubectl-ai
2- FROM golang:1.24.3 AS builder
1+ ARG GO_VERSION=1.24.3
32
4- WORKDIR /src
3+ FROM golang:${GO_VERSION}-bookworm as builder
54
5+ WORKDIR /src
66COPY go.mod go.sum ./
77COPY gollm/ ./gollm/
88RUN go mod download
@@ -12,7 +12,6 @@ COPY pkg/ ./pkg/
1212
1313RUN CGO_ENABLED=0 go build -o kubectl-ai ./cmd/
1414
15- # kubectl tool
1615FROM debian:bookworm-slim AS kubectl-tool
1716ENV DEBIAN_FRONTEND=noninteractive
1817RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && \
@@ -23,19 +22,16 @@ WORKDIR /opt/tools/kubectl
2322RUN curl -L -v https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl -o /opt/tools/kubectl/bin/kubectl
2423RUN chmod +x /opt/tools/kubectl/bin/kubectl
2524
26- # Actual kubectl-ai image
27- FROM debian:bookworm-slim
25+ FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim as runtime
2826
29- ENV DEBIAN_FRONTEND=noninteractive
27+ RUN apt-get update && \
28+ apt-get install -y --no-install-recommends google-cloud-cli-gke-gcloud-auth-plugin && \
29+ apt-get clean && \
30+ rm -rf /var/lib/apt/lists/*
3031
3132COPY --from=builder /src/kubectl-ai /bin/kubectl-ai
3233COPY --from=kubectl-tool /opt/tools/kubectl/ /opt/tools/kubectl/
3334
3435RUN ln -sf /opt/tools/kubectl/bin/kubectl /bin/kubectl
3536
36- RUN apt-get update && apt-get install -y --no-install-recommends \
37- ca-certificates && \
38- apt-get clean && \
39- rm -rf /var/lib/apt/lists/*
40-
4137ENTRYPOINT [ "/bin/kubectl-ai" ]
You can’t perform that action at this time.
0 commit comments