-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathDockerfile.foxy
66 lines (52 loc) · 2.95 KB
/
Dockerfile.foxy
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
# Copyright 2020 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM osrf/ros:foxy-desktop
ARG CARTOGRAPHER_VERSION=master
# We require a GitHub access token to be passed.
ARG github_token
# The base image doesn't ship with sudo and wstool.
RUN apt-get update && apt-get install -y sudo python3-wstool
# First, we invalidate the entire cache if cartographer-project/cartographer has
# changed. This file's content changes whenever master changes. See:
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \
cartographer_ros/cartographer_version.json
# wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_dev_workspace.sh cartographer_ros/scripts/
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_dev_workspace.sh
# rosdep needs the updated package.xml files to install the correct debs.
COPY cartographer_ros/package.xml dev_ws/src/cartographer_ros/cartographer_ros/
COPY cartographer_ros_msgs/package.xml dev_ws/src/cartographer_ros/cartographer_ros_msgs/
COPY cartographer_rviz/package.xml dev_ws/src/cartographer_ros/cartographer_rviz/
COPY scripts/install_debs.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_debs.sh
# Install Abseil.
RUN /dev_ws/src/cartographer/scripts/install_abseil.sh
# Build, install, and test all packages individually to allow caching. The
# ordering of these steps must match the topological package ordering.
COPY scripts/install_and_test.sh cartographer_ros/scripts/
RUN cartographer_ros/scripts/install_and_test.sh cartographer
# TODO(MichaelGrupp): Activate all build steps for ROS2 once they work.
# COPY cartographer_ros_msgs dev_ws/src/cartographer_ros/cartographer_ros_msgs
# RUN cartographer_ros/scripts/install_and_test.sh cartographer_ros_msgs
# COPY cartographer_ros dev_ws/src/cartographer_ros/cartographer_ros
# RUN cartographer_ros/scripts/install_and_test.sh cartographer_ros
# COPY cartographer_rviz dev_ws/src/cartographer_ros/cartographer_rviz
# RUN cartographer_ros/scripts/install_and_test.sh cartographer_rviz
RUN rm -rf /var/lib/apt/lists/*
# A BTRFS bug may prevent us from cleaning up these directories.
# https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_cannot_delete_an_empty_directory
RUN rm -rf cartographer_ros || true