# Plynth's ROS 2 packages on ROS 2 Jazzy: the ride example and the Open-RMF lift and door adapter, built in /ws.
# test.sh copies the robot kit's wheel here, builds this, and runs both against a local sandbox.
FROM ros:jazzy-ros-base
# socat is for test.sh: inside the container it brings the host's sandbox to 127.0.0.1 (see README.md).
RUN apt-get update && apt-get install -y --no-install-recommends \
        ros-jazzy-rmf-lift-msgs ros-jazzy-rmf-door-msgs python3-pip socat \
    && rm -rf /var/lib/apt/lists/*
# The kit's client (the plynth package) into the system Python that ROS runs on.
COPY plynth_robot_kit-*.whl /tmp/
RUN pip3 install --no-cache-dir --break-system-packages /tmp/plynth_robot_kit-*.whl && rm /tmp/plynth_robot_kit-*.whl
COPY src /ws/src
RUN cd /ws && . /opt/ros/jazzy/setup.sh && colcon build && rm -rf build log
# Every command, docker run's or docker exec /ros_entrypoint.sh's, starts with the workspace sourced.
RUN sed -i 's|/opt/ros/$ROS_DISTRO/setup.bash|/ws/install/setup.bash|' /ros_entrypoint.sh
