From aea33250ba62d0e970ccda95d728876aae398286 Mon Sep 17 00:00:00 2001 From: Samuel Sadok Date: Wed, 18 Dec 2024 09:59:03 +0000 Subject: [PATCH] add jazzy devcontainer --- .devcontainer/jazzy/Dockerfile | 26 ++++++++++++++++++++++++++ .devcontainer/jazzy/devcontainer.json | 19 +++++++++++++++++++ .github/workflows/ros-build-test.yaml | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/jazzy/Dockerfile create mode 100644 .devcontainer/jazzy/devcontainer.json diff --git a/.devcontainer/jazzy/Dockerfile b/.devcontainer/jazzy/Dockerfile new file mode 100644 index 0000000..5b9963f --- /dev/null +++ b/.devcontainer/jazzy/Dockerfile @@ -0,0 +1,26 @@ +FROM ros:jazzy-ros-base + +# Add vscode user with same UID and GID as your host system +# (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user) +ARG USERNAME=ubuntu +RUN apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME +# Switch from root to user +USER $USERNAME + +# Add user to video group to allow access to webcam +RUN sudo usermod --append --groups video $USERNAME + +# Update all packages +RUN sudo apt update && sudo apt upgrade -y + +# Install Git +RUN sudo apt install -y git + +# Rosdep update +RUN rosdep update + +# Source the ROS setup file +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc diff --git a/.devcontainer/jazzy/devcontainer.json b/.devcontainer/jazzy/devcontainer.json new file mode 100644 index 0000000..f701931 --- /dev/null +++ b/.devcontainer/jazzy/devcontainer.json @@ -0,0 +1,19 @@ +{ + "name": "jazzy", + "dockerFile": "Dockerfile", + "runArgs": [ + "--privileged", + "--network=host" + ], + "workspaceMount": "source=${localWorkspaceFolder},target=/${localWorkspaceFolderBasename},type=bind", + "workspaceFolder": "/${localWorkspaceFolderBasename}", + "mounts": [], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "eamodio.gitlens" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/ros-build-test.yaml b/.github/workflows/ros-build-test.yaml index 4321d99..dae64ce 100644 --- a/.github/workflows/ros-build-test.yaml +++ b/.github/workflows/ros-build-test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ros-version: [humble, iron] + ros-version: [humble, iron, jazzy] steps: - name: Check out code