Initial commit

Nothing has been tested yet.
This commit is contained in:
2026-04-15 18:12:23 +01:00
commit 845f61e710
27 changed files with 1840 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
FROM ros:kilted
ARG USERNAME=USERNAME
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Delete user if it exists in container (e.g Ubuntu Noble: ubuntu)
RUN if id -u $USER_UID ; then userdel `id -un $USER_UID` ; fi
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN apt-get update && apt-get upgrade -y
# C++ development tools
RUN apt-get install -y \
build-essential \
cmake \
gdb \
clang \
clang-format \
clang-tidy \
libboost-all-dev
# Python development tools
RUN apt-get install -y \
python3-pip \
python3-dev \
python3-argcomplete \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool
# ROS 2 ament build tools
# RUN apt-get install -y \
# ros-${ROS_DISTRO}-ament-cmake \
# ros-${ROS_DISTRO}-ament-cmake-auto \
# ros-${ROS_DISTRO}-ament-python \
# ros-${ROS_DISTRO}-ament-lint-auto \
# ros-${ROS_DISTRO}-ament-lint-common
ENV SHELL /bin/bash
# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************
# [Optional] Set the default user. Omit if you want to keep the default as root.
USER $USERNAME
CMD ["/bin/bash"]
+42
View File
@@ -0,0 +1,42 @@
{
"name": "ROS 2 Development Container",
"privileged": true,
"remoteUser": "matt",
"build": {
"dockerfile": "Dockerfile",
"args": {
"USERNAME": "matt"
}
},
"workspaceFolder": "/home/ws",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ws,type=bind",
"customizations": {
"vscode": {
"extensions":[
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"twxs.cmake",
"donjayamanne.python-extension-pack",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"anthropic.claude-code"
]
}
},
"containerEnv": {
"DISPLAY": "unix:0",
"ROS_AUTOMATIC_DISCOVERY_RANGE": "LOCALHOST",
"ROS_DOMAIN_ID": "42"
},
"runArgs": [
"--net=host",
"--pid=host",
"--ipc=host",
"-e", "DISPLAY=${env:DISPLAY}"
],
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/dev/dri,target=/dev/dri,type=bind,consistency=cached"
],
"postCreateCommand": "sudo rosdep update && sudo rosdep install --from-paths src --ignore-src -y && sudo chown -R $(whoami) /home/ws/"
}