Dockerfile.base.melodic 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright 2018 The Cartographer Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. FROM ros:melodic
  15. ARG CARTOGRAPHER_VERSION=master
  16. # Bionic's base image doesn't ship with sudo.
  17. RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
  18. # First, we invalidate the entire cache if googlecartographer/cartographer has
  19. # changed. This file's content changes whenever master changes. See:
  20. # http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
  21. ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/master \
  22. cartographer_ros/cartographer_version.json
  23. # wstool needs the updated rosinstall file to clone the correct repos.
  24. COPY cartographer_ros.rosinstall cartographer_ros/
  25. COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
  26. RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
  27. cartographer_ros/scripts/prepare_catkin_workspace.sh
  28. # rosdep needs the updated package.xml files to install the correct debs.
  29. COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
  30. COPY cartographer_ros_msgs/package.xml catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
  31. COPY cartographer_rviz/package.xml catkin_ws/src/cartographer_ros/cartographer_rviz/
  32. COPY scripts/install_debs.sh cartographer_ros/scripts/
  33. RUN cartographer_ros/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/*
  34. # Install proto3.
  35. RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh