forked from surfertas/ros2_ipcamera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (60 loc) · 1.73 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
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM osrf/ros2:nightly
# install ROS2 dependencies
RUN apt-get update && apt-get install -q -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-vcstool \
wget \
&& rm -rf /var/lib/apt/lists/*
# copy ros package repo
ENV IPCAMERA_WS /opt/ipcamera_ws
RUN mkdir -p $IPCAMERA_WS/src
WORKDIR $IPCAMERA_WS/src
COPY ./ ros2_ipcamera/
# clone dependency package repos
ENV ROS_WS /opt/ros_ws
RUN mkdir -p $ROS_WS/src
WORKDIR $ROS_WS
# https://github.com/dirk-thomas/vcstool
RUN vcs import src < $IPCAMERA_WS/src/ros2_ipcamera/tools/ros2_dependencies.repos
# install dependency package dependencies
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
apt-get update && \
rosdep install -q -y \
--from-paths \
src \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*
# build dependency package source
ARG CMAKE_BUILD_TYPE=Release
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
colcon build \
--symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
# install package dependencies
WORKDIR $IPCAMERA_WS
RUN . $ROS_WS/install/setup.sh && \
apt-get update && \
rosdep install -q -y \
--from-paths \
$ROS_WS/src \
src \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*
ARG COVERAGE_ENABLED=False
RUN . $ROS_WS/install/setup.sh && \
colcon build \
--symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCOVERAGE_ENABLED=$COVERAGE_ENABLED
# source workspace from entrypoint
RUN sed --in-place \
's|^source .*|source "$IPCAMERA_WS/install/setup.bash"|' \
/ros_entrypoint.sh
# install editor
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]