forked from ros-navigation/navigation2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.crystal
57 lines (50 loc) · 1.65 KB
/
Dockerfile.crystal
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
# This dockerfile expects proxies to be set via --build-arg if needed
# It also expects to be contained in the /navigation2 root folder for file copy
#
# Example build command:
# export CMAKE_BUILD_TYPE=Debug
# export BUILD_SYSTEM_TESTS=False
# docker build -t nav2:crystal --build-arg BUILD_SYSTEM_TESTS
# --build-arg CMAKE_BUILD_TYPE -f Dockerfile.crystal ./
FROM ros:crystal
# 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 NAV2_WS /opt/nav2_ws
RUN mkdir -p $NAV2_WS/src
WORKDIR $NAV2_WS/src
COPY ./ navigation2/
# delete nav2_system_tests/COLCON_IGNORE before running rosdep, otherwise it
# doesn't install nav2_system_tests dependencies.
ARG BUILD_SYSTEM_TESTS=True
RUN if [ "$BUILD_SYSTEM_TESTS" = "True" ] ; then \
rm $NAV2_WS/src/navigation2/nav2_system_tests/COLCON_IGNORE ; \
echo "Building of system tests enabled" ; \
fi
# install navigation2 package dependencies
WORKDIR $NAV2_WS
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 navigation2 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
# source navigation2 workspace from entrypoint
RUN sed --in-place --expression \
'$isource "$NAV2_WS/install/setup.bash"' \
/ros_entrypoint.sh