From 03b69b706454258afc39a45e5344ad3aaf6a71a8 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Fri, 9 Nov 2018 20:00:15 -0800 Subject: [PATCH 1/8] Update Dockerfile with template for breaking build cache --- gazebo/7/ubuntu/xenial/gzserver7/Dockerfile | 4 ++++ gazebo/8/ubuntu/xenial/gzserver8/Dockerfile | 4 ++++ gazebo/9/ubuntu/bionic/gzserver9/Dockerfile | 4 ++++ gazebo/9/ubuntu/xenial/gzserver9/Dockerfile | 4 ++++ ros/indigo/ubuntu/trusty/ros-core/Dockerfile | 4 ++++ ros/kinetic/ubuntu/xenial/ros-core/Dockerfile | 4 ++++ ros/lunar/debian/stretch/ros-core/Dockerfile | 4 ++++ ros/lunar/ubuntu/xenial/ros-core/Dockerfile | 4 ++++ ros/melodic/debian/stretch/ros-core/Dockerfile | 4 ++++ ros/melodic/ubuntu/bionic/ros-core/Dockerfile | 4 ++++ ros2/ardent/ubuntu/xenial/ros-core/Dockerfile | 4 ++++ ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile | 4 ++++ 12 files changed, 48 insertions(+) diff --git a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile index accab9524..f1ba947c7 100644 --- a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile +++ b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile @@ -16,6 +16,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD8 RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list +# break build cache for sync +RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ + && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" + # install gazebo packages RUN apt-get update && apt-get install -q -y \ gazebo7=7.14.0-1* \ diff --git a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile index e3c7d39a2..44bea7677 100644 --- a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile +++ b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile @@ -16,6 +16,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD8 RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list +# break build cache for sync +RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ + && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" + # install gazebo packages RUN apt-get update && apt-get install -q -y \ gazebo8=8.6.0-1* \ diff --git a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile index b65b519b3..8e681d8b7 100644 --- a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile @@ -21,6 +21,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD8 RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list +# break build cache for sync +RUN echo "Release: Mon, 05 Nov 2018 18:49:39 UTC" \ + && echo "Digest: a9070691c4920f2b0c241a81cdf379fa3f289464653aec1572fe36d3c360eb60" + # install gazebo packages RUN apt-get update && apt-get install -q -y \ gazebo9=9.4.1-1* \ diff --git a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile index fb4d8c65c..8afea7937 100644 --- a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile @@ -16,6 +16,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD8 RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list +# break build cache for sync +RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ + && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" + # install gazebo packages RUN apt-get update && apt-get install -q -y \ gazebo9=9.4.1-1* \ diff --git a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile index f61d49493..440074e6a 100644 --- a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile +++ b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile @@ -15,6 +15,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:38:37 UTC" \ + && echo "Digest: 1a7920929ce7448b84f070d1d0eaea07afde13ef7c7a4e62019f1940c8048920" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile index 300049976..2ab73c6fb 100644 --- a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile @@ -15,6 +15,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:39:08 UTC" \ + && echo "Digest: dd05b19fc0734f40e9ff9f58c13bd161aabec38094898fc6db48feb28d16fef6" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros/lunar/debian/stretch/ros-core/Dockerfile b/ros/lunar/debian/stretch/ros-core/Dockerfile index 13cb0d31f..750ce0cba 100644 --- a/ros/lunar/debian/stretch/ros-core/Dockerfile +++ b/ros/lunar/debian/stretch/ros-core/Dockerfile @@ -15,6 +15,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:38:30 UTC" \ + && echo "Digest: ba3ffae2de2f654dbc4b7b38b97d8ad7dfffa090b158740b0989b8b28705f1c6" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile index cebb71557..66ebb4eae 100644 --- a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile @@ -15,6 +15,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:39:08 UTC" \ + && echo "Digest: dd05b19fc0734f40e9ff9f58c13bd161aabec38094898fc6db48feb28d16fef6" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros/melodic/debian/stretch/ros-core/Dockerfile b/ros/melodic/debian/stretch/ros-core/Dockerfile index b74bc4ce3..abbcdb9a8 100644 --- a/ros/melodic/debian/stretch/ros-core/Dockerfile +++ b/ros/melodic/debian/stretch/ros-core/Dockerfile @@ -15,6 +15,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:38:30 UTC" \ + && echo "Digest: ba3ffae2de2f654dbc4b7b38b97d8ad7dfffa090b158740b0989b8b28705f1c6" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile index 835ce89c9..091dafd40 100644 --- a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile +++ b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile @@ -20,6 +20,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 # setup sources.list RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list +# break build cache for sync +RUN echo "Release: Tue, 06 Nov 2018 23:37:34 UTC" \ + && echo "Digest: eff7634f9172d9a18dfa99905fa22f9ada4892aa43ec20f6bba51f816cbe2430" + # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ python-rosdep \ diff --git a/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile b/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile index 78b665ad3..d190a07dd 100644 --- a/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile +++ b/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile @@ -18,6 +18,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN . /etc/os-release \ && echo "deb http://repo.ros2.org/$ID/main `lsb_release -sc` main" > /etc/apt/sources.list.d/ros2-latest.list +# break build cache for sync +RUN echo "Release: Wed, 07 Nov 2018 20:26:22 UTC" \ + && echo "Digest: 20b8e180c067738666248434ec59ccd2acf358e57fef5367bfb3638779888b24" + # setup environment ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 diff --git a/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile b/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile index dd00090c7..e99d8fb73 100644 --- a/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile +++ b/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile @@ -23,6 +23,10 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN . /etc/os-release \ && echo "deb http://repo.ros2.org/$ID/main `lsb_release -sc` main" > /etc/apt/sources.list.d/ros2-latest.list +# break build cache for sync +RUN echo "Release: Wed, 07 Nov 2018 20:26:04 UTC" \ + && echo "Digest: 9e47b9f84027b455a10f54714c9eba1c07440d066ddee1cb4d5b7cb26f69f674" + # setup environment ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 From 8e4a5376f204a270edb4e95a5fa4464c8954b3c9 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Fri, 16 Nov 2018 19:21:50 -0800 Subject: [PATCH 2/8] Use digest to check InRelease --- gazebo/7/ubuntu/xenial/gzserver7/Dockerfile | 9 +++++++-- gazebo/8/ubuntu/xenial/gzserver8/Dockerfile | 9 +++++++-- gazebo/9/ubuntu/bionic/gzserver9/Dockerfile | 9 +++++++-- gazebo/9/ubuntu/xenial/gzserver9/Dockerfile | 9 +++++++-- ros/indigo/ubuntu/trusty/ros-core/Dockerfile | 9 +++++++-- ros/kinetic/ubuntu/xenial/ros-core/Dockerfile | 9 +++++++-- ros/lunar/debian/stretch/ros-core/Dockerfile | 9 +++++++-- ros/lunar/ubuntu/xenial/ros-core/Dockerfile | 9 +++++++-- ros/melodic/debian/stretch/ros-core/Dockerfile | 9 +++++++-- ros/melodic/ubuntu/bionic/ros-core/Dockerfile | 9 +++++++-- ros2/ardent/ubuntu/xenial/ros-core/Dockerfile | 9 +++++++-- ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile | 9 +++++++-- 12 files changed, 84 insertions(+), 24 deletions(-) diff --git a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile index f1ba947c7..1011021b5 100644 --- a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile +++ b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile @@ -17,8 +17,13 @@ RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list # break build cache for sync -RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ - && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ + && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install gazebo packages RUN apt-get update && apt-get install -q -y \ diff --git a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile index 44bea7677..63b9ec4da 100644 --- a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile +++ b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile @@ -17,8 +17,13 @@ RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list # break build cache for sync -RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ - && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ + && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install gazebo packages RUN apt-get update && apt-get install -q -y \ diff --git a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile index 8e681d8b7..1db2822c4 100644 --- a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile @@ -22,8 +22,13 @@ RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list # break build cache for sync -RUN echo "Release: Mon, 05 Nov 2018 18:49:39 UTC" \ - && echo "Digest: a9070691c4920f2b0c241a81cdf379fa3f289464653aec1572fe36d3c360eb60" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Mon, 05 Nov 2018 18:49:39 UTC" \ + && export SUM=3c94e1c056520e06ba10d425c883463b3287c6eb506d410e6c939739ee301c92 \ + && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install gazebo packages RUN apt-get update && apt-get install -q -y \ diff --git a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile index 8afea7937..59f132ca4 100644 --- a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile @@ -17,8 +17,13 @@ RUN . /etc/os-release \ && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list # break build cache for sync -RUN echo "Release: Fri, 09 Nov 2018 14:51:50 UTC" \ - && echo "Digest: 1b1a9870d531fcfee20ae1ab3df60d499d6b206c11fe30e3c89dd111ae31c756" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ + && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install gazebo packages RUN apt-get update && apt-get install -q -y \ diff --git a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile index 440074e6a..2df2bee59 100644 --- a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile +++ b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile @@ -16,8 +16,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:38:37 UTC" \ - && echo "Digest: 1a7920929ce7448b84f070d1d0eaea07afde13ef7c7a4e62019f1940c8048920" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Tue, 13 Nov 2018 01:48:44 UTC" \ + && export SUM=de8d7f7d977657db972f2da900b68566e1b0dd9cb6549d545ef0b01e3d75c27a \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile index 2ab73c6fb..1f698c5ac 100644 --- a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile @@ -16,8 +16,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:39:08 UTC" \ - && echo "Digest: dd05b19fc0734f40e9ff9f58c13bd161aabec38094898fc6db48feb28d16fef6" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Tue, 13 Nov 2018 04:34:23 UTC" \ + && export SUM=21ac875851b7ca891e6e427f51df7b14f505b17c333e05785a031ef3dad6b9af \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros/lunar/debian/stretch/ros-core/Dockerfile b/ros/lunar/debian/stretch/ros-core/Dockerfile index 750ce0cba..80b67f4c9 100644 --- a/ros/lunar/debian/stretch/ros-core/Dockerfile +++ b/ros/lunar/debian/stretch/ros-core/Dockerfile @@ -16,8 +16,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:38:30 UTC" \ - && echo "Digest: ba3ffae2de2f654dbc4b7b38b97d8ad7dfffa090b158740b0989b8b28705f1c6" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Wed, 07 Nov 2018 20:29:26 UTC" \ + && export SUM=d04dcc78816835dfda9d4c037f5851b2e02052cb312ab87837b9450786332ec5 \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile index 66ebb4eae..b97c80f6d 100644 --- a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile @@ -16,8 +16,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:39:08 UTC" \ - && echo "Digest: dd05b19fc0734f40e9ff9f58c13bd161aabec38094898fc6db48feb28d16fef6" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Tue, 13 Nov 2018 04:34:23 UTC" \ + && export SUM=21ac875851b7ca891e6e427f51df7b14f505b17c333e05785a031ef3dad6b9af \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros/melodic/debian/stretch/ros-core/Dockerfile b/ros/melodic/debian/stretch/ros-core/Dockerfile index abbcdb9a8..e5d8e4ddd 100644 --- a/ros/melodic/debian/stretch/ros-core/Dockerfile +++ b/ros/melodic/debian/stretch/ros-core/Dockerfile @@ -16,8 +16,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:38:30 UTC" \ - && echo "Digest: ba3ffae2de2f654dbc4b7b38b97d8ad7dfffa090b158740b0989b8b28705f1c6" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Wed, 07 Nov 2018 20:29:26 UTC" \ + && export SUM=d04dcc78816835dfda9d4c037f5851b2e02052cb312ab87837b9450786332ec5 \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile index 091dafd40..b0029ae41 100644 --- a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile +++ b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile @@ -21,8 +21,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9 RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list # break build cache for sync -RUN echo "Release: Tue, 06 Nov 2018 23:37:34 UTC" \ - && echo "Digest: eff7634f9172d9a18dfa99905fa22f9ada4892aa43ec20f6bba51f816cbe2430" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Wed, 07 Nov 2018 20:28:21 UTC" \ + && export SUM=2de21a79d3855575334e8ac2f4c77bcd6b7a627acce0a10762abaf42bb37fe4c \ + && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # install bootstrap tools RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile b/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile index d190a07dd..82adb5193 100644 --- a/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile +++ b/ros2/ardent/ubuntu/xenial/ros-core/Dockerfile @@ -19,8 +19,13 @@ RUN . /etc/os-release \ && echo "deb http://repo.ros2.org/$ID/main `lsb_release -sc` main" > /etc/apt/sources.list.d/ros2-latest.list # break build cache for sync -RUN echo "Release: Wed, 07 Nov 2018 20:26:22 UTC" \ - && echo "Digest: 20b8e180c067738666248434ec59ccd2acf358e57fef5367bfb3638779888b24" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Thu, 15 Nov 2018 21:55:38 UTC" \ + && export SUM=de61d8080249e357538955cde224fe4d6ace3542201c37b8b90d20af96cd16e1 \ + && export FILE=/var/lib/apt/lists/repo.ros2.org_ubuntu_main_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # setup environment ENV LANG C.UTF-8 diff --git a/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile b/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile index e99d8fb73..45f102dd1 100644 --- a/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile +++ b/ros2/bouncy/ubuntu/bionic/ros-core/Dockerfile @@ -24,8 +24,13 @@ RUN . /etc/os-release \ && echo "deb http://repo.ros2.org/$ID/main `lsb_release -sc` main" > /etc/apt/sources.list.d/ros2-latest.list # break build cache for sync -RUN echo "Release: Wed, 07 Nov 2018 20:26:04 UTC" \ - && echo "Digest: 9e47b9f84027b455a10f54714c9eba1c07440d066ddee1cb4d5b7cb26f69f674" +RUN apt-get update \ + && . /etc/os-release \ + && echo "Release: Thu, 15 Nov 2018 21:55:19 UTC" \ + && export SUM=d18772441d1abd08e247af6cba22207e4f207306e6b98be79c53d0c074bc2ec1 \ + && export FILE=/var/lib/apt/lists/repo.ros2.org_ubuntu_main_dists_$(lsb_release -sc)_InRelease \ + && echo "$SUM *$FILE" | sha256sum --check \ + && rm -rf /var/lib/apt/lists/* # setup environment ENV LANG C.UTF-8 From f96ab24cc5d8328bdfd1ab1527cccf416c9e6cf9 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Wed, 27 Feb 2019 16:31:30 -0800 Subject: [PATCH 3/8] Add script to update InRelease hashes Signed-off-by: Shane Loretz --- update_cache_busting_hashes.py | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 update_cache_busting_hashes.py diff --git a/update_cache_busting_hashes.py b/update_cache_busting_hashes.py new file mode 100755 index 000000000..07b0ba481 --- /dev/null +++ b/update_cache_busting_hashes.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 + +import hashlib +import os +import re +import requests +import sys + + +def get_sha256_sum(url): + hasher = hashlib.sha256() + text = requests.get(url).text + # Convert unicode object to bytes using sytem encoding + encoded_text = text.encode(sys.stdin.encoding) + # hash it + hasher.update(encoded_text) + return hasher.digest().hex() + + +if __name__ == '__main__': + + urls = [ + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/bionic/InRelease", + "http://packages.ros.org/ros/ubuntu/dists/trusty/InRelease", + "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", + "http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease", + "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", + "http://repo.ros2.org/ubuntu/main/dists/xenial/InRelease", + "http://repo.ros2.org/ubuntu/main/dists/bionic/InRelease", + ] + + url_hashes = {} + for url in urls: + hash_output = get_sha256_sum(url) + url_hashes[url] = hash_output + print(url) + print("\t" + hash_output) + + paths = { + "gazebo/7/ubuntu/xenial/gzserver7/Dockerfile": + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", + "gazebo/8/ubuntu/xenial/gzserver8/Dockerfile": + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", + "gazebo/9/ubuntu/bionic/gzserver9/Dockerfile": + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/bionic/InRelease", + "gazebo/9/ubuntu/xenial/gzserver9/Dockerfile": + "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", + "ros/indigo/ubuntu/trusty/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/trusty/InRelease", + "ros/kinetic/ubuntu/xenial/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", + "ros/lunar/debian/stretch/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", + "ros/lunar/ubuntu/xenial/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", + "ros/melodic/debian/stretch/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", + "ros/melodic/ubuntu/bionic/ros-core/Dockerfile": + "http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease", + "ros/ardent/ubuntu/xenial/ros-core/Dockerfile": + "http://repo.ros2.org/ubuntu/main/dists/xenial/InRelease", + "ros/bouncy/ubuntu/bionic/ros-core/Dockerfile": + "http://repo.ros2.org/ubuntu/main/dists/bionic/InRelease", + } + + for path, url in paths.items(): + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), path) + if not os.path.isfile(path): + raise RuntimeError("{} does not exist".format(path)) + + with open(path, 'r') as file_in: + content = file_in.read() + + sum_regex = r'SUM=[a-f0-9]+' + new_sum = 'SUM=' + url_hashes[url] + new_content = re.sub(sum_regex, new_sum, content) + + with open(path, 'w') as file_out: + file_out.write(new_content) From bb6818865e9b82d15e39b2fdca02db45cb33eb2d Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Wed, 27 Feb 2019 16:31:53 -0800 Subject: [PATCH 4/8] Update dockerfile InRelease hashes Signed-off-by: Shane Loretz --- gazebo/7/ubuntu/xenial/gzserver7/Dockerfile | 2 +- gazebo/8/ubuntu/xenial/gzserver8/Dockerfile | 2 +- gazebo/9/ubuntu/bionic/gzserver9/Dockerfile | 2 +- gazebo/9/ubuntu/xenial/gzserver9/Dockerfile | 2 +- ros/ardent/ubuntu/xenial/ros-core/Dockerfile | 2 +- ros/bouncy/ubuntu/bionic/ros-core/Dockerfile | 2 +- ros/indigo/ubuntu/trusty/ros-core/Dockerfile | 2 +- ros/kinetic/ubuntu/xenial/ros-core/Dockerfile | 2 +- ros/lunar/debian/stretch/ros-core/Dockerfile | 2 +- ros/lunar/ubuntu/xenial/ros-core/Dockerfile | 2 +- ros/melodic/debian/stretch/ros-core/Dockerfile | 2 +- ros/melodic/ubuntu/bionic/ros-core/Dockerfile | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile index 1011021b5..ac284e823 100644 --- a/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile +++ b/gazebo/7/ubuntu/xenial/gzserver7/Dockerfile @@ -20,7 +20,7 @@ RUN . /etc/os-release \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ - && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export SUM=c69ce7a69a8b65d88037a1b0aa39ce76ab6355787751afe725a79eda512e5e02 \ && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile index 63b9ec4da..e44ae3813 100644 --- a/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile +++ b/gazebo/8/ubuntu/xenial/gzserver8/Dockerfile @@ -20,7 +20,7 @@ RUN . /etc/os-release \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ - && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export SUM=c69ce7a69a8b65d88037a1b0aa39ce76ab6355787751afe725a79eda512e5e02 \ && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile index 61367189b..f817c76b2 100644 --- a/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/bionic/gzserver9/Dockerfile @@ -25,7 +25,7 @@ RUN . /etc/os-release \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Mon, 05 Nov 2018 18:49:39 UTC" \ - && export SUM=3c94e1c056520e06ba10d425c883463b3287c6eb506d410e6c939739ee301c92 \ + && export SUM=ff31390e9da2b14d15f324620b11cde338224731c174612e84cc277d766d62a9 \ && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile index a5e5c2355..2c8f66041 100644 --- a/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile +++ b/gazebo/9/ubuntu/xenial/gzserver9/Dockerfile @@ -20,7 +20,7 @@ RUN . /etc/os-release \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Fri, 16 Nov 2018 16:26:55 UTC" \ - && export SUM=021bafbd47748fa31505efcf66f499f8f9d7601c18f6d8456ec76686b76711df \ + && export SUM=c69ce7a69a8b65d88037a1b0aa39ce76ab6355787751afe725a79eda512e5e02 \ && export FILE=/var/lib/apt/lists/packages.osrfoundation.org_gazebo_$ID-stable_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/ardent/ubuntu/xenial/ros-core/Dockerfile b/ros/ardent/ubuntu/xenial/ros-core/Dockerfile index 786cba7de..eefdc5648 100644 --- a/ros/ardent/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/ardent/ubuntu/xenial/ros-core/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Thu, 15 Nov 2018 21:55:38 UTC" \ - && export SUM=de61d8080249e357538955cde224fe4d6ace3542201c37b8b90d20af96cd16e1 \ + && export SUM=579ae6c6a96debdfb8300b998836ae23f3f6ea6609c0ab768af1b97885d4e7ce \ && export FILE=/var/lib/apt/lists/repo.ros2.org_ubuntu_main_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/bouncy/ubuntu/bionic/ros-core/Dockerfile b/ros/bouncy/ubuntu/bionic/ros-core/Dockerfile index 89c756af5..120ded17a 100644 --- a/ros/bouncy/ubuntu/bionic/ros-core/Dockerfile +++ b/ros/bouncy/ubuntu/bionic/ros-core/Dockerfile @@ -32,7 +32,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Thu, 15 Nov 2018 21:55:19 UTC" \ - && export SUM=d18772441d1abd08e247af6cba22207e4f207306e6b98be79c53d0c074bc2ec1 \ + && export SUM=125999ff7a89681dc97846b7adb233b342c469543c4a4832a22a6f82d4eb130b \ && export FILE=/var/lib/apt/lists/repo.ros2.org_ubuntu_main_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile index 2df2bee59..0f830ecdc 100644 --- a/ros/indigo/ubuntu/trusty/ros-core/Dockerfile +++ b/ros/indigo/ubuntu/trusty/ros-core/Dockerfile @@ -19,7 +19,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Tue, 13 Nov 2018 01:48:44 UTC" \ - && export SUM=de8d7f7d977657db972f2da900b68566e1b0dd9cb6549d545ef0b01e3d75c27a \ + && export SUM=b75a2d320917414042fd631bc44c6003414bf2c197c09e0ba73264633bc72345 \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile index 1f698c5ac..52ef65c98 100644 --- a/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile @@ -19,7 +19,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Tue, 13 Nov 2018 04:34:23 UTC" \ - && export SUM=21ac875851b7ca891e6e427f51df7b14f505b17c333e05785a031ef3dad6b9af \ + && export SUM=a243a54b0cea230b6e84d30ad38d8374f986ce38c166d38e6dbd6aaa0b38730e \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/lunar/debian/stretch/ros-core/Dockerfile b/ros/lunar/debian/stretch/ros-core/Dockerfile index 80b67f4c9..2168a5ddd 100644 --- a/ros/lunar/debian/stretch/ros-core/Dockerfile +++ b/ros/lunar/debian/stretch/ros-core/Dockerfile @@ -19,7 +19,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Wed, 07 Nov 2018 20:29:26 UTC" \ - && export SUM=d04dcc78816835dfda9d4c037f5851b2e02052cb312ab87837b9450786332ec5 \ + && export SUM=019320d9c5c4095c0b44dbc1e6f695d9ebc583bafba9adfa1faed3a20c49d066 \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile index b97c80f6d..59d663fb4 100644 --- a/ros/lunar/ubuntu/xenial/ros-core/Dockerfile +++ b/ros/lunar/ubuntu/xenial/ros-core/Dockerfile @@ -19,7 +19,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Tue, 13 Nov 2018 04:34:23 UTC" \ - && export SUM=21ac875851b7ca891e6e427f51df7b14f505b17c333e05785a031ef3dad6b9af \ + && export SUM=a243a54b0cea230b6e84d30ad38d8374f986ce38c166d38e6dbd6aaa0b38730e \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/melodic/debian/stretch/ros-core/Dockerfile b/ros/melodic/debian/stretch/ros-core/Dockerfile index e5d8e4ddd..f5584ef06 100644 --- a/ros/melodic/debian/stretch/ros-core/Dockerfile +++ b/ros/melodic/debian/stretch/ros-core/Dockerfile @@ -19,7 +19,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Wed, 07 Nov 2018 20:29:26 UTC" \ - && export SUM=d04dcc78816835dfda9d4c037f5851b2e02052cb312ab87837b9450786332ec5 \ + && export SUM=019320d9c5c4095c0b44dbc1e6f695d9ebc583bafba9adfa1faed3a20c49d066 \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* diff --git a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile index 48390a1ec..f3d1c3ce1 100644 --- a/ros/melodic/ubuntu/bionic/ros-core/Dockerfile +++ b/ros/melodic/ubuntu/bionic/ros-core/Dockerfile @@ -24,7 +24,7 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/ RUN apt-get update \ && . /etc/os-release \ && echo "Release: Wed, 07 Nov 2018 20:28:21 UTC" \ - && export SUM=2de21a79d3855575334e8ac2f4c77bcd6b7a627acce0a10762abaf42bb37fe4c \ + && export SUM=ceaf565b4dc80632569158783e148d7a8d05118cffb7ff34617f9ca18cca5bfc \ && export FILE=/var/lib/apt/lists/packages.ros.org_ros_ubuntu_dists_$(lsb_release -sc)_InRelease \ && echo "$SUM *$FILE" | sha256sum --check \ && rm -rf /var/lib/apt/lists/* From 8931512f43d8174a8fed58cc929297ec654d96d0 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Mon, 11 Mar 2019 15:13:37 -0700 Subject: [PATCH 5/8] Add script to create official-images PRs Signed-off-by: Shane Loretz --- pr_docker_library.py | 147 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 pr_docker_library.py diff --git a/pr_docker_library.py b/pr_docker_library.py new file mode 100644 index 000000000..873591d20 --- /dev/null +++ b/pr_docker_library.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 + +import datetime +import difflib +import git # gitpython +import github +import os +import shutil +import tempfile + + +# Path to root of this repo +BASE_PATH = os.path.dirname(os.path.abspath(__file__)) +# Path to official docker library repo +DOCKER_LIBRARY_REPO_URL = 'git@github.com:docker-library/official-images.git' +DOCKER_LIBRARY_REPO = 'docker-library/official-images' +# Path to fork to update with docker images +FORK_LIBRARY_REPO_URL = 'git@github.com:ros-infrastructure/official-images.git' +FORK_LIBRARY_REPO = 'ros-infrastructure' + +# Token to use to interact with github +GIT_USER = os.environ.get('GITHUB_USER','') +GIT_EMAIL = os.environ.get('GITHUB_EMAIL','') +GIT_TOKEN = os.environ.get('GITHUB_TOKEN','') +GIT_AUTHOR = "{user} <{email}>".format(user=GIT_USER, email=GIT_EMAIL) +GIT_TOKEN = os.environ.get('GITHUB_TOKEN','') + + +PR_TEMPLATE = """ +# Update library definition for '{name}' + +
Diff + +```diff +{diff} +``` +
+""" + + +def read_local_library_definition(name): + # Library definition file for `ros` is in `ros/ros` + with open(os.path.join(BASE_PATH, name, name), 'r') as fin: + return fin.read() + + +def read_upstream_library_definition(name): + # Get the manifest from the upstream repo + with tempfile.TemporaryDirectory(prefix='osrf-docker-images') as temp_dir: + git.Repo.clone_from(DOCKER_LIBRARY_REPO_URL, temp_dir, depth=1) + with open(os.path.join(temp_dir, 'library', name)) as fin: + return fin.read() + + +def pr_with_sentinel_exists(sentinel): + gh_handle = github.Github(GIT_TOKEN) + repo = gh_handle.get_repo(DOCKER_LIBRARY_REPO) + for pr in repo.get_pulls(state='open'): + if sentinel in pr.body: + return True + return False + + +def diff_library_definitions(local_ldf, upstream_ldf): + differ = difflib.Differ() + diff = differ.compare( + upstream_ldf.splitlines(keepends=True), + local_ldf.splitlines(keepends=True)) + diff = ''.join(diff) + return diff + + +def update_library_definition_fork(name): + # Create branch on fork that is up to date with upstream + # write changed manifest to fork + # commit to new branch + # push branch to fork + branch_name = None + with tempfile.TemporaryDirectory(prefix='osrf-docker-images') as temp_dir: + # Clone fork repo locally with a remote for the official one + repo = git.Repo.clone_from(FORK_LIBRARY_REPO_URL, temp_dir, depth=1) + remote = repo.create_remote('upstream', DOCKER_LIBRARY_REPO_URL) + if not remote.exists(): + raise RuntimeError('Failed to find official docker library') + remote.fetch() + + # Create branch on fork repo tracking official docker library + d = datetime.datetime.utcnow() + d_str = d.strftime(r'%Y-%m-%d_%H-%M-%S') + branch_name = '{}/{}'.format(name, d_str) + head = repo.create_head(branch_name, remote.refs.master) + head.checkout() + + # Update the library definition file on the fork + shutil.copy( + os.path.join(BASE_PATH, name, name), + os.path.join(temp_dir, 'library', name)) + + repo.git.add(all=True) + message = 'Update library definition for ' + name + repo.git.commit(message=message, author=GIT_AUTHOR) + repo.remotes.origin.push(branch_name, set_upstream=True) + + print('created branch', branch_name) + + return branch_name + + +def create_upstream_pull_request(name, diff, branch_name): + # open pull request with template + gh_handle = github.Github(GIT_TOKEN) + repo = gh_handle.get_repo(DOCKER_LIBRARY_REPO) + pr = repo.create_pull( + title='Update ' + name, + head='{}:{}'.format(FORK_LIBRARY_REPO_USER, branch_name), + base='master', + body=PR_TEMPLATE.format(name=name, diff=diff)) + print('Created PR', pr.url) + + +def update_upstream_library_definition(name): + local_ldf = read_local_library_definition(name) + upstream_ldf = read_upstream_library_definition(name) + + if local_ldf == upstream_ldf: + print('Upstream LDF and local LDF for {} are in sync'.format(name)) + return + + diff = diff_library_definitions(local_ldf, upstream_ldf) + print('--- Diff for {}---'.format(name)) + print(diff) + print('--- End diff ---') + + if pr_with_sentinel_exists(diff): + print('Upstream PR alredy created, ignoring') + return + + fork_branch = update_library_definition_fork(name) + + # Create pull request + create_upstream_pull_request(name, diff, fork_branch) + + +if __name__ == '__main__': + + update_upstream_library_definition('ros') + update_upstream_library_definition('gazebo') From a6fcc52f08f55ae1d1071f1130e23c57076dfeb9 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Mon, 11 Mar 2019 15:19:04 -0700 Subject: [PATCH 6/8] Fix variable name Signed-off-by: Shane Loretz --- pr_docker_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_docker_library.py b/pr_docker_library.py index 873591d20..39351a81e 100644 --- a/pr_docker_library.py +++ b/pr_docker_library.py @@ -16,7 +16,7 @@ DOCKER_LIBRARY_REPO = 'docker-library/official-images' # Path to fork to update with docker images FORK_LIBRARY_REPO_URL = 'git@github.com:ros-infrastructure/official-images.git' -FORK_LIBRARY_REPO = 'ros-infrastructure' +FORK_LIBRARY_REPO_USER = 'ros-infrastructure' # Token to use to interact with github GIT_USER = os.environ.get('GITHUB_USER','') From 7fcdc9913cc1f73e263b06d1f7475b4045b9c1c9 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 19 Mar 2019 13:29:49 -0700 Subject: [PATCH 7/8] Main block reads HUB_REPO instead of hard coding --- pr_docker_library.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pr_docker_library.py b/pr_docker_library.py index 39351a81e..b326128e9 100644 --- a/pr_docker_library.py +++ b/pr_docker_library.py @@ -143,5 +143,4 @@ def update_upstream_library_definition(name): if __name__ == '__main__': - update_upstream_library_definition('ros') - update_upstream_library_definition('gazebo') + update_upstream_library_definition(os.environ['HUB_REPO']) From 815e3ff4133e9042324f2f71c01adb7b239fdeff Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 19 Mar 2019 14:30:02 -0700 Subject: [PATCH 8/8] Delete update_cache_busting_hashes.py --- update_cache_busting_hashes.py | 80 ---------------------------------- 1 file changed, 80 deletions(-) delete mode 100755 update_cache_busting_hashes.py diff --git a/update_cache_busting_hashes.py b/update_cache_busting_hashes.py deleted file mode 100755 index 07b0ba481..000000000 --- a/update_cache_busting_hashes.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 - -import hashlib -import os -import re -import requests -import sys - - -def get_sha256_sum(url): - hasher = hashlib.sha256() - text = requests.get(url).text - # Convert unicode object to bytes using sytem encoding - encoded_text = text.encode(sys.stdin.encoding) - # hash it - hasher.update(encoded_text) - return hasher.digest().hex() - - -if __name__ == '__main__': - - urls = [ - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/bionic/InRelease", - "http://packages.ros.org/ros/ubuntu/dists/trusty/InRelease", - "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", - "http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease", - "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", - "http://repo.ros2.org/ubuntu/main/dists/xenial/InRelease", - "http://repo.ros2.org/ubuntu/main/dists/bionic/InRelease", - ] - - url_hashes = {} - for url in urls: - hash_output = get_sha256_sum(url) - url_hashes[url] = hash_output - print(url) - print("\t" + hash_output) - - paths = { - "gazebo/7/ubuntu/xenial/gzserver7/Dockerfile": - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", - "gazebo/8/ubuntu/xenial/gzserver8/Dockerfile": - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", - "gazebo/9/ubuntu/bionic/gzserver9/Dockerfile": - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/bionic/InRelease", - "gazebo/9/ubuntu/xenial/gzserver9/Dockerfile": - "http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/xenial/InRelease", - "ros/indigo/ubuntu/trusty/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/trusty/InRelease", - "ros/kinetic/ubuntu/xenial/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", - "ros/lunar/debian/stretch/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", - "ros/lunar/ubuntu/xenial/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease", - "ros/melodic/debian/stretch/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/stretch/InRelease", - "ros/melodic/ubuntu/bionic/ros-core/Dockerfile": - "http://packages.ros.org/ros/ubuntu/dists/bionic/InRelease", - "ros/ardent/ubuntu/xenial/ros-core/Dockerfile": - "http://repo.ros2.org/ubuntu/main/dists/xenial/InRelease", - "ros/bouncy/ubuntu/bionic/ros-core/Dockerfile": - "http://repo.ros2.org/ubuntu/main/dists/bionic/InRelease", - } - - for path, url in paths.items(): - path = os.path.join(os.path.dirname(os.path.abspath(__file__)), path) - if not os.path.isfile(path): - raise RuntimeError("{} does not exist".format(path)) - - with open(path, 'r') as file_in: - content = file_in.read() - - sum_regex = r'SUM=[a-f0-9]+' - new_sum = 'SUM=' + url_hashes[url] - new_content = re.sub(sum_regex, new_sum, content) - - with open(path, 'w') as file_out: - file_out.write(new_content)