Skip to content

Commit 67486de

Browse files
committed
🔨 Updated Dockerfile for optimisation and to set default RMW to be CycloneDDS.
Signed-off-by: gary.bey <gary.bey@kabam.ai>
1 parent 54cabc0 commit 67486de

File tree

4 files changed

+28
-31
lines changed

4 files changed

+28
-31
lines changed

Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
FROM ros:jazzy-perception-noble
2-
3-
# Add user
4-
RUN adduser --quiet --disabled-password user
5-
1+
ARG ROS_DISTRO=jazzy
2+
FROM ros:$ROS_DISTRO-perception-noble
63
ENV DEBIAN_FRONTEND=noninteractive
7-
# Install OpenCV
8-
RUN apt-get update && \
9-
apt-get install -y xauth xxd x11-xserver-utils && \
4+
5+
# Install dependencies
6+
RUN apt-get update && apt-get install -y \
7+
ros-$ROS_DISTRO-rmw-cyclonedds-cpp \
8+
xauth \
9+
xxd \
10+
x11-xserver-utils && \
1011
rm -rf /var/lib/apt/lists/*
1112

12-
WORKDIR /home/user/virtual_camera_ws
13+
WORKDIR /virtual_camera_ws
1314
RUN mkdir src
1415
COPY . src/virtual_camera
1516

16-
# colcon compilation
17+
# Build virtual_camera ROS 2 package
1718
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
1819
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
1920

20-
RUN sed -i '$isource "/home/user/virtual_camera_ws/install/setup.bash"' /ros_entrypoint.sh
21-
22-
RUN chown -R user:user /home/user/
23-
USER user
21+
RUN sed -i '$isource "/virtual_camera_ws/install/setup.bash"' /ros_entrypoint.sh
2422

25-
ENTRYPOINT ["/ros_entrypoint.sh"]
23+
ENTRYPOINT ["/ros_entrypoint.sh"]

scripts/1_create_docker_container.bash

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
xhost +local:docker
4+
5+
docker run -it --rm \
6+
--network host \
7+
--name vcam_test_container \
8+
-e DISPLAY=$DISPLAY \
9+
-e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \
10+
-v /tmp/.X11-unix:/tmp/.X11-unix \
11+
vcam_image:jazzy bash -c \
12+
"ros2 launch virtual_camera showimageraw.launch.py \
13+
use_image_viewer:=true"
14+
15+
xhost -local:docker

0 commit comments

Comments
 (0)