Dockerfile.kinetic 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 2016 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 osrf/ros:kinetic-desktop
  15. ARG CARTOGRAPHER_VERSION=master
  16. # We require a GitHub access token to be passed.
  17. ARG github_token
  18. # Xenial's base image doesn't ship with sudo.
  19. RUN apt-get update && apt-get install -y sudo
  20. # First, we invalidate the entire cache if cartographer-project/cartographer has
  21. # changed. This file's content changes whenever master changes. See:
  22. # http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
  23. ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \
  24. cartographer_ros/cartographer_version.json
  25. # wstool needs the updated rosinstall file to clone the correct repos.
  26. COPY cartographer_ros.rosinstall cartographer_ros/
  27. COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
  28. RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
  29. cartographer_ros/scripts/prepare_catkin_workspace.sh
  30. # rosdep needs the updated package.xml files to install the correct debs.
  31. COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/
  32. COPY cartographer_ros_msgs/package.xml catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
  33. COPY cartographer_rviz/package.xml catkin_ws/src/cartographer_ros/cartographer_rviz/
  34. COPY scripts/install_debs.sh cartographer_ros/scripts/
  35. RUN cartographer_ros/scripts/install_debs.sh
  36. # Install Abseil and proto3.
  37. RUN /catkin_ws/src/cartographer/scripts/install_abseil.sh
  38. RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh
  39. # Build, install, and test all packages individually to allow caching. The
  40. # ordering of these steps must match the topological package ordering as
  41. # determined by Catkin.
  42. COPY scripts/install.sh cartographer_ros/scripts/
  43. COPY scripts/catkin_test_results.sh cartographer_ros/scripts/
  44. RUN cartographer_ros/scripts/install.sh --pkg cartographer && \
  45. cartographer_ros/scripts/install.sh --pkg cartographer --make-args test
  46. COPY cartographer_ros_msgs catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
  47. RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs && \
  48. cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs \
  49. --catkin-make-args run_tests && \
  50. cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros_msgs
  51. COPY cartographer_ros catkin_ws/src/cartographer_ros/cartographer_ros/
  52. RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros && \
  53. cartographer_ros/scripts/install.sh --pkg cartographer_ros \
  54. --catkin-make-args run_tests && \
  55. cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros
  56. COPY cartographer_rviz catkin_ws/src/cartographer_ros/cartographer_rviz/
  57. RUN cartographer_ros/scripts/install.sh --pkg cartographer_rviz && \
  58. cartographer_ros/scripts/install.sh --pkg cartographer_rviz \
  59. --catkin-make-args run_tests && \
  60. cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_rviz
  61. COPY scripts/ros_entrypoint.sh /
  62. RUN rm -rf /var/lib/apt/lists/*
  63. # A BTRFS bug may prevent us from cleaning up these directories.
  64. # https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_cannot_delete_an_empty_directory
  65. RUN rm -rf cartographer_ros catkin_ws || true