-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (44 loc) · 1.81 KB
/
Dockerfile
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
51
52
53
54
55
56
57
ARG ROS_DISTRO=humble
ARG PREFIX=
FROM ros:$ROS_DISTRO-ros-base AS pkg-builder
# select bash as default shell
SHELL ["/bin/bash", "-c"]
WORKDIR /ros2_ws
ARG DEPTHAI_ROS_RELEASE="v2.8.1-${ROS_DISTRO}"
RUN apt-get update && apt-get install -y \
python3-pip \
python3-colcon-common-extensions \
python3-rosdep
# install everything needed
RUN git clone https://github.com/luxonis/depthai-ros.git src/depthai-ros -b ${DEPTHAI_ROS_RELEASE} && \
git clone https://github.com/ros-misc-utilities/ffmpeg_image_transport.git src/ffmpeg_image_transport && \
vcs import src < src/ffmpeg_image_transport/ffmpeg_image_transport.repos && \
rm -rf /etc/ros/rosdep/sources.list.d/20-default.list && \
rosdep init && \
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src --ignore-src -r -y && \
source /opt/ros/$ROS_DISTRO/setup.bash && \
MAKEFLAGS="-j1 -l1" colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
FROM husarnet/ros:${PREFIX}${ROS_DISTRO}-ros-core
ARG PREFIX
ENV PREFIX_ENV=$PREFIX
# select bash as default shell
SHELL ["/bin/bash", "-c"]
COPY --from=pkg-builder /ros2_ws /ros2_ws
WORKDIR /ros2_ws
# installing deppendencies from rosdep
RUN apt-get update && apt-get install -y \
python3-pip \
python3-colcon-common-extensions \
python3-rosdep && \
rm -rf /etc/ros/rosdep/sources.list.d/20-default.list && \
rosdep init && \
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src --ignore-src -r -y && \
apt-get clean && \
apt-get remove -y \
python3-pip \
python3-colcon-common-extensions \
python3-rosdep && \
rm -rf /var/lib/apt/lists/*
RUN echo $(cat /ros2_ws/src/depthai-ros/depthai-ros/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt