Add devcontainer
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
FROM osrf/ros:jazzy-desktop-full
|
||||
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 --no-install-recommends sudo \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Make sure the base image is completely up to date
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
# C++ development tools
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
gdb \
|
||||
clang \
|
||||
clang-format \
|
||||
clang-tidy \
|
||||
libboost-all-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Python development tools
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python3-argcomplete \
|
||||
python3-colcon-common-extensions \
|
||||
python3-colcon-mixin \
|
||||
python3-rosdep \
|
||||
python3-vcstool \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Optional: pre-install apt dependencies resolved from rosdep on a previous run.
|
||||
COPY .devcontainer/jazzy/ /tmp/devcontainer-jazzy/
|
||||
|
||||
RUN apt-get update \
|
||||
&& if [ -f /tmp/devcontainer-jazzy/rosdep-apt-packages.txt ]; then \
|
||||
grep -Ev '^\s*($|#)' /tmp/devcontainer-jazzy/rosdep-apt-packages.txt | xargs -r apt-get install -y --no-install-recommends; \
|
||||
fi \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 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
|
||||
|
||||
# [Optional] Set the default user. Omit if you want to keep the default as root.
|
||||
USER $USERNAME
|
||||
CMD ["/bin/bash"]
|
||||
Reference in New Issue
Block a user