mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-04-20 15:56:07 -04:00
first successful launch of veilid devcontainer
This commit is contained in:
parent
203b2ada32
commit
2c42efe1db
33
.devcontainer/Dockerfile
Normal file
33
.devcontainer/Dockerfile
Normal 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"]
|
32
.devcontainer/devcontainer.json
Normal file
32
.devcontainer/devcontainer.json
Normal 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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user