diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3892e57451c51d05fc811f7659e04774241254ff --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,34 @@ +# The devcontainer will be based on debian +# The base container already has entrypoint, vscode user account, etc. out of the box +FROM mcr.microsoft.com/vscode/devcontainers/base:bullseye + +# Set permissions for mounts in devcontainer.json +RUN mkdir -p /home/vscode/.vscode-server/bin +RUN chown -R vscode:vscode /home/vscode/.vscode-server + +# Update and install some basic tools inside the container +# Adjust this list based on your demands +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + sshpass \ + curl \ + iputils-ping \ + htop \ + zsh \ + nano \ + vim \ + tmux \ + nload \ + yamllint \ + && rm -rf /var/lib/apt/lists/* \ + && rm -Rf /usr/share/doc && rm -Rf /usr/share/man \ + && apt-get clean + +# Install oh-my-zsh for more terminal features and set is as primary shell +ENV SHELL /bin/zsh +RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true + +# Set editor +RUN echo "export VISUAL='nano'" >> /home/vscode/.zshrc +RUN echo "export EDITOR='nano'" >> /home/vscode/.zshrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000000000000000000000000000000..d04d543195bb098da64d048f3a7bdd2e2b2acfc5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python + { + "name": "ekms-develop-go", + "build": { + "dockerfile": "Dockerfile" + }, + "features": { + "ghcr.io/devcontainers/features/go:1": { + "version": "1.21" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2.7": { + "version": "latest" + } + }, + // add any required extensions that must be pre-installed in the devcontainer + "customizations": { + "vscode": { + "extensions": [ + "golang.go", + "ms-azuretools.vscode-docker", + "EditorConfig.EditorConfig", + "eamodio.gitlens", + "ms-vscode.makefile-tools", + "redhat.vscode-yaml", + "valentjn.vscode-ltex" + ] + } + }, + "mounts": [ + // Source: https://github.com/microsoft/vscode-remote-release/issues/5823 + // Creates a named volume mounted to /home/vscode. Survives a rebuild. + // Creates a named volume mounted to /root/.docker. Survives a rebuild. + // Creates an anonymous volume mounted to /home/vscode/.vscode-server. Gets destroyed on rebuild, which allows vscode to reinstall the extensions and dotfiles. + "source=ekms-vscode-home-dir,target=/home/vscode,type=volume", + "source=ekms-docker-root-config,target=/root/.docker,type=volume", + "target=/home/vscode/.vscode-server,type=volume" + ] + } diff --git a/.gitignore b/.gitignore index 2bb892256003300275fd67384c02225c06f3f3fd..53ac7f5682104000265d132e5e3665281828cec8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ artifacts/ gostructs.go # non vimmers -.devcontainer/ .vscode/ .idea/