create py.tar.gz which omits timestamps
* By doing this, we will get the same py.tar.gz everytime, so that we
will have reproducible fully-loaded container with a same sha256
Tested:
- started two builds and ends with docker images with a same sha256
- container/debian8-clang-fully-loaded/build.sh -p my-project -c
debian8-clang-fl -t test-image-{1,2} -a
Change-Id: Ib8bb050b7e050f879709742dfff4ac9f8960975b
EDIT
diff --git a/container/debian8-clang-fully-loaded/BUILD b/container/debian8-clang-fully-loaded/BUILD
index d3acab4..602410b 100644
--- a/container/debian8-clang-fully-loaded/BUILD
+++ b/container/debian8-clang-fully-loaded/BUILD
@@ -108,6 +108,8 @@
},
symlinks = {
"/usr/bin/python": "/usr/bin/python2.7",
+ "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
+ "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
},
tags = ["manual"],
tars = ["//third_party/python:tar"],
diff --git a/container/debian8-clang-fully-loaded/Dockerfile.py.build b/container/debian8-clang-fully-loaded/Dockerfile.py.build
index d47cb8d..2c04383 100644
--- a/container/debian8-clang-fully-loaded/Dockerfile.py.build
+++ b/container/debian8-clang-fully-loaded/Dockerfile.py.build
@@ -15,12 +15,7 @@
# Pin to the latest l.gcr.io/google/python container
FROM l.gcr.io/google/python@sha256:49f0264ae8ea6993c03773aa6cc7b7bb14f977d7e67780974375cbd74b376144
-# Make proper alias
-WORKDIR /opt/python3.6/bin
-RUN ln -s python3.6 python3
-RUN ln -s pip3.6 pip3
-
# Tar the python3 interpreter which was compiled from source, see
# https://github.com/GoogleCloudPlatform/python-runtime/tree/master/python-interpreter-builder
WORKDIR /
-RUN tar czf /tmp/py.tar.gz /opt/python3.6
+RUN GZIP=-n tar -czf /tmp/py.tar.gz --mtime='1970-01-01' /opt/python3.6
diff --git a/container/debian8-clang-fully-loaded/cloudbuild.yaml b/container/debian8-clang-fully-loaded/cloudbuild.yaml
index 8c522c4..d0a6c14 100644
--- a/container/debian8-clang-fully-loaded/cloudbuild.yaml
+++ b/container/debian8-clang-fully-loaded/cloudbuild.yaml
@@ -56,6 +56,7 @@
args: ['run' , '//${_DIR}:fl-toolchain']
id: 'fl-container'
waitFor:
+ - "copy-py"
- "builder"
# Step: re-tag the image