-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.cpu
37 lines (30 loc) · 1.02 KB
/
Dockerfile.cpu
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
ARG ROS_DISTRO=humble
ARG PREFIX=
FROM husarnet/ros:${PREFIX}${ROS_DISTRO}-ros-base
SHELL ["/bin/bash", "-c"]
# Install tools
RUN apt-get update && apt install -y \
git \
libhidapi-libusb0 \
libopencv-viz-dev \
udev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Workspace & dependencies
WORKDIR /ros2_ws
RUN apt-get update && \
git clone -b ros2 https://github.com/husarion/zed_cpu.git src/zed_cpu && \
source /opt/ros/$ROS_DISTRO/setup.bash && \
rosdep install --from-paths src -y -i && \
cd src/zed_cpu/udev && \
bash install_udev_rule.sh && \
rm -rf /var/lib/apt/lists/*
# Build
RUN source /opt/ros/$ROS_DISTRO/setup.bash && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release && \
rm -rf build log src
# Git action version
RUN echo $(cat /ros2_ws/src/zed_cpu/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt
# Setup entrypoint
COPY ./ros_entrypoint.sh /
ENTRYPOINT ["/ros_entrypoint.sh"]