-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Note: You can use any Debian/Ubuntu based image you want. | ||
ARG IMAGE | ||
FROM ${IMAGE} | ||
# Enable new "BUILDKIT" mode for Docker CLI | ||
ENV DOCKER_BUILDKIT=1 \ | ||
PATH=$PATH:/usr/local/go/bin \ | ||
TERM=xterm-256color | ||
|
||
# Options | ||
ARG INSTALL_ZSH="true" | ||
ARG UPGRADE_PACKAGES="false" | ||
ARG USE_MOBY="true" | ||
ARG USERNAME=vscode | ||
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. | ||
COPY kubernetes/library-scripts/*.sh /tmp/library-scripts/ | ||
|
||
RUN apt-get clean \ | ||
&& apt-get update \ | ||
&& /bin/bash /tmp/library-scripts/docker-debian.sh "true" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}" "true" \ | ||
&& /bin/bash /tmp/library-scripts/kubectl-helm-debian.sh "latest" "latest" "none" \ | ||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/ | ||
|
||
# Script copies localhost's ~/.kube/config file into the container and swaps out | ||
# localhost for host.docker.internal on bash/zsh start to keep them in sync. | ||
COPY resources/copy-kube-config.sh /usr/local/share/ | ||
RUN chown ${USERNAME}:root /usr/local/share/copy-kube-config.sh \ | ||
&& echo "source /usr/local/share/copy-kube-config.sh" | tee -a /root/.bashrc /root/.zshrc /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt update \ | ||
&& apt -y install --no-install-recommends kubectx make wget | ||
|
||
COPY resources/install_k9s.sh ./install_k9s.sh | ||
|
||
RUN /bin/bash install_k9s.sh | ||
|
||
# Setting the ENTRYPOINT to docker-init.sh will configure non-root access to | ||
# the Docker socket if "overrideCommand": false is set in devcontainer.json. | ||
# The script will also execute CMD if you need to alter startup behaviors. | ||
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] | ||
CMD ["sleep", "infinity" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters