Skip to content

Commit 27a7652

Browse files
committed
build: add minikube installation to devcontainer Dockerfile
- Install kubectl, helm, and minikube directly in Dockerfile - Support both amd64 and arm64 architectures - Use latest stable versions
1 parent a8266d1 commit 27a7652

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

.github/.devcontainer/Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV LANG="C.UTF-8" \
1111
RUN apt-get update \
1212
&& apt-get upgrade -y \
1313
&& apt-get install -y --no-install-recommends \
14-
# Core essentials (changes rarely)
14+
# Core essentials (changes rarely)
1515
ca-certificates \
1616
curl \
1717
git \
@@ -80,6 +80,24 @@ RUN mkdir -p /go/bin /go/src /go/pkg
8080
# Install Atlas for MySQL migration
8181
RUN curl -sSf https://atlasgo.sh | sh -s -- -y
8282

83+
# Install kubectl, helm, and minikube
84+
RUN ARCH=$(dpkg --print-architecture) \
85+
&& case $ARCH in \
86+
amd64) KUBECTL_ARCH="amd64"; HELM_ARCH="amd64"; MINIKUBE_ARCH="amd64" ;; \
87+
arm64) KUBECTL_ARCH="arm64"; HELM_ARCH="arm64"; MINIKUBE_ARCH="arm64" ;; \
88+
*) echo "Unsupported architecture: $ARCH" && exit 1 ;; \
89+
esac \
90+
# Install kubectl
91+
&& curl -fsSL "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${KUBECTL_ARCH}/kubectl" -o /usr/local/bin/kubectl \
92+
&& chmod +x /usr/local/bin/kubectl \
93+
# Install helm
94+
&& curl -fsSL https://get.helm.sh/helm-v3.16.4-linux-${HELM_ARCH}.tar.gz | tar -C /tmp -xzf - \
95+
&& mv /tmp/linux-${HELM_ARCH}/helm /usr/local/bin/helm \
96+
&& rm -rf /tmp/linux-${HELM_ARCH} \
97+
# Install minikube
98+
&& curl -fsSL "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-${MINIKUBE_ARCH}" -o /usr/local/bin/minikube \
99+
&& chmod +x /usr/local/bin/minikube
100+
83101
# Mount for docker-in-docker
84102
VOLUME [ "/var/lib/docker" ]
85103

0 commit comments

Comments
 (0)