Files
ros-raspbot-v2/.devcontainer/Dockerfile
T

68 lines
2.0 KiB
Docker

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 update && apt-get install -y \
build-essential \
cmake \
gdb \
clang \
clang-format \
clang-tidy \
libboost-all-dev
# Python development tools
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv \
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
# Node.js for frontend development
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs
# Python venv for webui backend (isolated from system packages)
RUN python3 -m venv /opt/webui-venv \
&& /opt/webui-venv/bin/pip install --no-cache-dir \
fastapi \
"uvicorn[standard]" \
numpy
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"]