Initial shared dev container

This commit is contained in:
2025-09-05 15:18:31 +02:00
commit 40800b56b3
2 changed files with 70 additions and 0 deletions

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM osrf/ros:jazzy-desktop-full-noble
SHELL [ "/bin/bash" , "-c" ]
# Add sourcing ROS setup.bash to .bashrc
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc
RUN echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
RUN echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc
RUN echo "export _colcon_cd_root=/opt/ros/jazzy/" >> ~/.bashrc

61
devcontainer.json Normal file
View File

@@ -0,0 +1,61 @@
{
"name": "osrf/ros:jazzy-desktop-full-noble",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
// "--cap-add=SYS_PTRACE", // Allows the container to trace processes using ptrace system call
// "--security-opt=seccomp=unconfined", // Disables seccomp security profiles for the container
// "--ipc=host", // Shares the host's IPC namespace with the container
"--network=host" // Shares the host's network namespace with the container
// "--pid=host", // Shares the host's PID namespace with the container
// "--privileged", // Gives the container full access to the host's devices and allows it to run with root privileges
],
"workspaceMount": "source=${localWorkspaceFolder},target=/${localWorkspaceFolderBasename},type=bind",
"workspaceFolder": "/${localWorkspaceFolderBasename}",
// for linux
"containerEnv": {
// Uncomment to allow the container to access the X server on the host e.g. to run Rviz and other GUI tools
"DISPLAY": "${localEnv:DISPLAY}",
"TZ": "Europe/Amsterdam"
},
"mounts": [
// Uncomment to allow the container to access the X server on the host e.g. to run Rviz and other GUI tools
{
"source": "/tmp/.X11-unix",
"target": "/tmp/.X11-unix",
"type": "bind"
},
// Uncomment to persist bash history between sessions
{
"source": "${localEnv:HOME}${localEnv:USERPROFILE}/.bash_history",
"target": "/root/.bash_history",
"type": "bind"
},
// add dri3
{
"source": "/dev/dri",
"target": "/dev/dri",
"type": "bind"
}
],
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"albert.tabout",
"eamodio.gitlens",
"donjayamanne.githistory",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ranch-hand-robotics.rde-pack",
"nonanonno.vscode-ros2"
]
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {}
}
}