-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.ros
87 lines (72 loc) · 3.06 KB
/
Dockerfile.ros
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This is a legacy building format with ros:humble-base and ubuntu as the base.
# Legacy format is not maintained anymore, see /Dockerfile for multiarch building with Yocto and OpenEmbedded.
FROM ghcr.io/tiiuae/fog-ros-baseimage-builder:v2.1.0 AS builder
ARG BUILD_GSTREAMER
# TODO: not sure how many of these deps are actually needed for building. at least this:
# libusb-1.0-0-dev
# gstreamer-1.0 (<-- but not sure which package brings this)
RUN apt-get update -y && apt-get install -y --no-install-recommends \
libusb-1.0-0-dev \
nlohmann-json3-dev \
libopencv-dev \
&& rm -rf /var/lib/apt/lists/*
RUN if [ -n "$BUILD_GSTREAMER" ]; then \
apt-get update -y && apt-get install -y --no-install-recommends \
libgstreamer1.0-0 \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstrtspserver-1.0-dev \
libgstreamer-plugins-base1.0-0 \
libgstreamer-plugins-good1.0-0 \
gstreamer1.0-x \
&& rm -rf /var/lib/apt/lists/*; \
fi
RUN curl https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob \
-o /tmp/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob
COPY . /main_ws/src/
RUN if [ -n "$BUILD_GSTREAMER" ]; then \
mv /main_ws/src/debian/control.em.gstreamer /main_ws/src/debian/control.em; \
fi
# this:
# 1) builds the application
# 2) packages the application as .deb in /main_ws/
RUN BUILD_GSTREAMER=$BUILD_GSTREAMER /packaging/build.sh
# ▲ runtime ──┐
# └── build ▼
FROM ghcr.io/tiiuae/fog-ros-baseimage:v2.1.0
ARG BUILD_GSTREAMER
RUN mkdir /depthai_configs
COPY --from=builder /main_ws/src/params /depthai_configs/.
COPY --from=builder /tmp/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob /depthai_configs/.
VOLUME /depthai_configs
ENV DEPTHAI_PARAM_FILE /depthai_configs/parameters.yaml
ENTRYPOINT [ "/entrypoint.sh" ]
COPY entrypoint.sh /entrypoint.sh
COPY --from=builder /main_ws/ros-*-depthai-ctrl_*_amd64.deb /depthai.deb
# The multi-arch build has the unnecessary line "/etc/init.d/udev start" for udev rules.
# Not needed in ubuntu OS baseimage
RUN sed -i '/\/etc\/init.d\/udev start/d' /entrypoint.sh
# need update because ROS people have a habit of removing old packages pretty fast
RUN apt-get update -y && apt-get install -y --no-install-recommends \
libusb-1.0-0-dev \
libopencv-dev \
ros-${ROS_DISTRO}-vision-msgs \
ros-${ROS_DISTRO}-camera-info-manager \
ros-${ROS_DISTRO}-cv-bridge \
ros-${ROS_DISTRO}-robot-state-publisher \
ros-${ROS_DISTRO}-image-transport \
ros-$ROS_DISTRO-xacro \
&& rm -rf /var/lib/apt/lists/*
RUN if [ -n "$BUILD_GSTREAMER" ]; then \
apt-get update -y && apt-get install -y --no-install-recommends \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gir1.2-gst-rtsp-server-1.0 \
gstreamer1.0-libav \
gstreamer1.0-rtsp \
&& rm -rf /var/lib/apt/lists/*; \
fi
RUN ln -s /usr/bin/true /usr/bin/udevadm \
&& dpkg -i /depthai.deb && rm /depthai.deb \
&& rm -f /usr/bin/udevadm