Skip to content

Commit

Permalink
feat: add kubectl and other extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Lauber <[email protected]>
  • Loading branch information
janlauber committed Nov 6, 2023
1 parent ac40eba commit bf9ab35
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

# Go workspace file
go.work
docker-code-server/
29 changes: 28 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,31 @@ RUN sed -i 's/abc/kubelab-agent/g' /usr/local/bin/install-extension
RUN sed -i 's/abc/kubelab-agent/g' /etc/s6-overlay/s6-rc.d/svc-code-server/run

# add --disable-workspace-trust to the exec of /etc/s6-overlay/s6-rc.d/svc-code-server/run
RUN sed -i '/\/app\/code-server\/bin\/code-server/a \\\t\t\t\t--disable-workspace-trust true \\' /etc/s6-overlay/s6-rc.d/svc-code-server/run
RUN sed -i '/\/app\/code-server\/bin\/code-server/a \\\t\t\t\t--disable-workspace-trust true \\' /etc/s6-overlay/s6-rc.d/svc-code-server/run

# install kubernetes vs code extension
RUN /app/code-server/bin/code-server --install-extension ms-kubernetes-tools.vscode-kubernetes-tools --extensions-dir /config/extensions

# Installing kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl

# Installing helm
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \
chmod +x ./get_helm.sh && \
./get_helm.sh && \
rm ./get_helm.sh

# Installing kustomize
RUN curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash && \
mv ./kustomize /usr/local/bin/kustomize

# Autocompletion for kubectl
RUN echo 'source <(kubectl completion bash)' >>/config/.bashrc
RUN echo 'alias k=kubectl' >>/config/.bashrc

# Autocompletion for helm
RUN echo 'source <(helm completion bash)' >>/config/.bashrc

RUN echo 'export PS1="\[\033[01;34m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\\$ "' >> /config/.bashrc

0 comments on commit bf9ab35

Please sign in to comment.