Skip to content

Commit de4e021

Browse files
authored
[WIP] Feat/docker image with gcloud (#412)
1 parent 30ab4f2 commit de4e021

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

images/kubectl-ai/Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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
66
COPY go.mod go.sum ./
77
COPY gollm/ ./gollm/
88
RUN go mod download
@@ -12,7 +12,6 @@ COPY pkg/ ./pkg/
1212

1313
RUN CGO_ENABLED=0 go build -o kubectl-ai ./cmd/
1414

15-
# kubectl tool
1615
FROM debian:bookworm-slim AS kubectl-tool
1716
ENV DEBIAN_FRONTEND=noninteractive
1817
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && \
@@ -23,19 +22,16 @@ WORKDIR /opt/tools/kubectl
2322
RUN curl -L -v https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl -o /opt/tools/kubectl/bin/kubectl
2423
RUN 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

3132
COPY --from=builder /src/kubectl-ai /bin/kubectl-ai
3233
COPY --from=kubectl-tool /opt/tools/kubectl/ /opt/tools/kubectl/
3334

3435
RUN 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-
4137
ENTRYPOINT [ "/bin/kubectl-ai" ]

0 commit comments

Comments
 (0)