-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (40 loc) · 1.56 KB
/
Dockerfile
File metadata and controls
48 lines (40 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM ros:jazzy-perception
LABEL maintainer="agomezchav@constructor.university"
ARG workspace=ros2ws
ARG rosversion=jazzy
ENV WORKSPACE=${workspace}
ENV ROSVERSION=${rosversion}
RUN echo "Building with ... ROSVERSION=$ROSVERSION"
# Install other necessary packages and dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
apt-utils \
vim \
git \
iputils-ping \
net-tools \
supervisor \
ros-${ROSVERSION}-rmw-cyclonedds-cpp \
ros-${ROSVERSION}-rmw-zenoh-cpp \
&& rm -rf /var/lib/apt/lists/*
# Additional ROS2 packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
ros-jazzy-qt-gui \
ros-jazzy-qt-gui-cpp \
ros-jazzy-rqt-gui \
ros-jazzy-rqt-gui-cpp \
ros-jazzy-rviz2 \
&& rm -rf /var/lib/apt/lists/*
# Upgrade everything
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -q -y \
&& rm -rf /var/lib/apt/lists/*
# Create initial workspace
RUN mkdir -p /home/${WORKSPACE}/src
# Source ROS and workspace in every bash session
RUN echo "source /opt/ros/${ROSVERSION}/setup.bash" >> /root/.bashrc && \
echo "if [ -f /home/${WORKSPACE}/install/setup.bash ]; then source /home/${WORKSPACE}/install/setup.bash; fi" >> /root/.bashrc
# Entrypoint runs colcon build on container startup
COPY entrypoint.sh /entrypoint.sh
COPY supervisord.conf /etc/supervisor/supervisord.conf
RUN mkdir -p /var/log/supervisor
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]