first successful launch of veilid devcontainer

This commit is contained in:
usrbinkat 2025-01-29 21:14:17 +00:00
parent 203b2ada32
commit 2c42efe1db
2 changed files with 65 additions and 0 deletions

33
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
FROM docker.io/library/rust:1.84.0-bullseye
# Create a non-root user with same UID/GID as host user
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Install basic tools
RUN apt-get update && apt-get install -y \
sudo \
curl \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
# Set working directory
WORKDIR /workspaces/veilid
# Set the default user
USER $USERNAME
# Expose port
EXPOSE 5150
# Set default shell to bash
ENV SHELL="/bin/bash"
CMD ["sleep", "infinity"]

View File

@ -0,0 +1,32 @@
{
"name": "veilid",
"dockerFile": "Dockerfile",
"overrideCommand": false,
"updateRemoteUserUID": true,
"remoteUser": "vscode",
"securityOpt": [
"seccomp=unconfined"
],
"runArgs": [
"--network=host",
"--cap-add=SYS_PTRACE",
"--security-opt=seccomp=unconfined"
],
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"postCreateCommand": "cargo --version",
"shutdownAction": "stopContainer",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},
"forwardPorts": [5150],
"init": true
}