Skip to content

Commit d819c64

Browse files
committed
πŸ§‘β€πŸ’» add devcontainer setup
1 parent da22e76 commit d819c64

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

β€Ž.devcontainer/Dockerfileβ€Ž

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Use the base dev container image
2+
FROM mcr.microsoft.com/devcontainers/base:ubuntu
3+
4+
# Update package lists and install required packages
5+
RUN apt-get update && apt-get install -y \
6+
curl \
7+
wget \
8+
btop \
9+
fontconfig \
10+
git \
11+
unzip \
12+
xz-utils \
13+
zip \
14+
libglu1-mesa \
15+
software-properties-common \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Install .NET 10 SDK
20+
RUN add-apt-repository ppa:dotnet/backports \
21+
&& apt-get update \
22+
&& apt-get install -y dotnet-sdk-10.0 \
23+
&& apt-get clean \
24+
&& rm -rf /var/lib/apt/lists/*
25+
26+
# Install Hack Nerd Font for terminal use
27+
RUN mkdir -p ~/.fonts && wget -q -P ~/.fonts https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip \
28+
&& unzip -o ~/.fonts/Hack.zip -d ~/.fonts && fc-cache -fv \
29+
&& rm -f ~/.fonts/Hack.zip
30+
31+
# Switch to the vscode user (assumes the user already exists in this base image)
32+
USER vscode
33+
34+
# Install Powerlevel10k theme
35+
RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/vscode/.oh-my-zsh/custom/themes/powerlevel10k \
36+
&& sed -i 's|ZSH_THEME=".*"|ZSH_THEME="powerlevel10k/powerlevel10k"|' /home/vscode/.zshrc
37+
38+
# Install Zsh plugins
39+
RUN git clone https://github.com/zsh-users/zsh-autosuggestions /home/vscode/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
40+
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting /home/vscode/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
41+
&& git clone https://github.com/zsh-users/zsh-history-substring-search /home/vscode/.oh-my-zsh/custom/plugins/history-substring-search \
42+
&& sed -i 's|plugins=(.*)|plugins=(git zsh-autosuggestions zsh-syntax-highlighting history-substring-search)|' /home/vscode/.zshrc
43+
44+
# Switch to the root user
45+
USER root
46+
47+
# Ensure proper permissions for the vscode user
48+
RUN chown -R vscode:vscode /home/vscode/.oh-my-zsh /home/vscode/.zshrc
49+
50+
# Switch to the vscode user (assumes the user already exists in this base image)
51+
USER vscode
52+
53+
# Set Zsh as the default shell and ensure the container starts with the vscode user
54+
WORKDIR /workspaces
55+
CMD [ "zsh" ]
56+
USER vscode
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "Ubuntu Dev Container",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"options": [
6+
"--ssh=default"
7+
]
8+
},
9+
"features": {
10+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
11+
"installDockerBuildx": true
12+
}
13+
},
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"vscode-icons-team.vscode-icons",
18+
"streetsidesoftware.code-spell-checker",
19+
"streetsidesoftware.code-spell-checker-german",
20+
"eamodio.gitlens",
21+
"seatonjiang.gitmoji-vscode",
22+
"ms-dotnettools.csdevkit"
23+
],
24+
"settings": {
25+
"editor.fontFamily": "Hack Nerd Font Mono",
26+
"editor.tabSize": 4,
27+
"editor.insertSpaces": true,
28+
"files.autoSave": "afterDelay",
29+
"git.enableSmartCommit": true,
30+
"git.confirmSync": false,
31+
"git.autofetch": true,
32+
"terminal.integrated.defaultProfile.linux": "zsh",
33+
"terminal.integrated.fontFamily": "Hack Nerd Font Mono",
34+
"telemetry.telemetryLevel": "crash",
35+
"workbench.colorTheme": "Default Dark Modern",
36+
"workbench.iconTheme": "vscode-icons",
37+
"cSpell.language": "de,en",
38+
"gitlens.telemetry.enabled": false
39+
}
40+
}
41+
},
42+
"remoteUser": "vscode"
43+
}

0 commit comments

Comments
Β (0)