Skip to content
Snippets Groups Projects
Commit 082f1981 authored by Malte Bauch's avatar Malte Bauch
Browse files

Add devcontainer

parent e27443e4
Branches
No related tags found
No related merge requests found
Pipeline #170812 failed
# 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
// 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"
]
}
...@@ -6,7 +6,6 @@ artifacts/ ...@@ -6,7 +6,6 @@ artifacts/
gostructs.go gostructs.go
# non vimmers # non vimmers
.devcontainer/
.vscode/ .vscode/
.idea/ .idea/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment