Skip to content

Commit 81ee53e

Browse files
committed
chore: Include kubectl/helm in the image
Signed-off-by: Qasim Sarfraz <[email protected]>
1 parent aabb0e9 commit 81ee53e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,26 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o aks-mcp ./cm
2525

2626
# Runtime stage
2727
FROM alpine:3.22
28+
ARG TARGETARCH
2829

2930
# Install required packages for kubectl and helm, plus build tools for Azure CLI
3031
RUN apk add --no-cache curl bash openssl ca-certificates git python3 py3-pip \
3132
gcc python3-dev musl-dev linux-headers
3233

34+
# Install kubectl
35+
RUN echo $TARGETARCH; curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl" && \
36+
chmod +x kubectl && \
37+
mv kubectl /usr/local/bin/kubectl
38+
39+
# Install helm
40+
RUN HELM_ARCH=${TARGETARCH} && \
41+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \
42+
chmod 700 get_helm.sh && \
43+
VERIFY_CHECKSUM=false ./get_helm.sh && \
44+
rm get_helm.sh
45+
3346
# Install Azure CLI
34-
RUN pip3 install --break-system-packages azure-cli
47+
RUN pip3 install --break-system-packages --no-cache-dir azure-cli
3548

3649
# Create the mcp user and group
3750
RUN addgroup -S mcp && \
@@ -52,7 +65,8 @@ EXPOSE 8000
5265
USER mcp
5366

5467
# Set environment variables
55-
ENV HOME=/home/mcp
68+
ENV HOME=/home/mcp \
69+
KUBECONFIG=/home/mcp/.kube/config
5670

5771
# Command to run
5872
ENTRYPOINT ["/usr/local/bin/aks-mcp"]

0 commit comments

Comments
 (0)