Add Dockerfile and devcontainer.json for development environment setup
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
# Install core Linux development utilities
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
ssh-client \
|
||||||
|
ca-certificates \
|
||||||
|
sudo \
|
||||||
|
gnupg \
|
||||||
|
procps \
|
||||||
|
unzip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Create a non-root user 'vscode' with sudo privileges
|
||||||
|
ARG USERNAME=vscode
|
||||||
|
ARG USER_UID=1000
|
||||||
|
ARG USER_GID=$USER_UID
|
||||||
|
|
||||||
|
RUN groupadd --gid $USER_GID $USERNAME \
|
||||||
|
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||||
|
&& echo $USERNAME ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||||
|
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||||
|
|
||||||
|
# Set the default user to the non-root user
|
||||||
|
USER $USERNAME
|
||||||
|
ENV HOME=/home/vscode
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "Generic Linux Dev Environment",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile"
|
||||||
|
},
|
||||||
|
"remoteUser": "vscode",
|
||||||
|
"updateRemoteUserUID": true,
|
||||||
|
|
||||||
|
"workspaceMount": "source=pi-hole-dev-vol,target=/workspace,type=volume",
|
||||||
|
"workspaceFolder": "/workspace",
|
||||||
|
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"vscode.git-base",
|
||||||
|
"vscode.git",
|
||||||
|
"mhutchie.git-graph",
|
||||||
|
"eamodio.gitlens"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrideCommand": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user