-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.12 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
49
50
FROM ros:humble-ros-base
ENV DEBIAN_FRONTEND=noninteractive
ENV ROS_DISTRO=humble
RUN apt-get update && apt-get install -y \
software-properties-common \
apt-transport-https \
ca-certificates \
gnupg \
wget \
git \
build-essential \
cmake \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
libmodbus-dev \
libmodbus5 \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-rclcpp \
ros-${ROS_DISTRO}-std-msgs \
ros-${ROS_DISTRO}-sensor-msgs \
ros-${ROS_DISTRO}-geometry-msgs \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /ros2_ws/src
COPY . /ros2_ws/src/modbus_interface/
WORKDIR /ros2_ws
RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \
colcon build --symlink-install && \
rm -rf build log"
RUN echo '#!/bin/bash\n\
source /opt/ros/${ROS_DISTRO}/setup.bash\n\
source /ros2_ws/install/setup.bash\n\
exec "$@"' > /ros_entrypoint.sh && \
chmod +x /ros_entrypoint.sh
RUN mkdir -p /etc/udev/rules.d
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]