From 26e956678fccfab80f86e184a2d4127994ff74e3 Mon Sep 17 00:00:00 2001 From: Damon Kohler Date: Tue, 25 Oct 2016 15:41:00 +0200 Subject: [PATCH] Fix Docker build caching. (#145) --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d75e03..45bf056 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,12 @@ FROM ros:indigo +# First, we invalidate the entire cache if googlecartographer/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/googlecartographer/cartographer/git/refs/heads/master \ + 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_catkin_workspace.sh cartographer_ros/scripts/ @@ -36,10 +42,6 @@ COPY scripts/install.sh cartographer_ros/scripts/ COPY ceres_solver catkin_ws/src/cartographer_ros/ RUN cartographer_ros/scripts/install.sh --pkg ceres_solver -# 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/googlecartographer/cartographer/git/refs/heads/master \ - cartographer_ros/cartographer_version.json RUN cartographer_ros/scripts/install.sh --pkg cartographer && \ cartographer_ros/scripts/install.sh --pkg cartographer --make-args test