Change cache key calculation to be more reproducible. (#525)

Before we were using the full image digest, but that contains a timestamp. Now
we only use the layers themselves and the image config (env vars, etc.).

Also fix a bug in unpacking the layers themselves. mtimes can change during unpacking,
so set them all once at the end.
This commit is contained in:
dlorenc
2019-01-23 13:46:12 -06:00
committed by GitHub
parent a493035287
commit 1ffae47fdd
5 changed files with 63 additions and 8 deletions
+11 -3
View File
@@ -16,7 +16,15 @@
# If the image is built twice, /date should be the same in both images
# if the cache is implemented correctly
FROM gcr.io/google-appengine/debian9@sha256:1d6a9a6d106bd795098f60f4abb7083626354fa6735e81743c7f8cfca11259f0
FROM alpine as base_stage
RUN mkdir foo && echo base_stage > foo/base
FROM base_stage as cached_stage
RUN echo cached_stage > foo/cache
FROM cached_stage as bug_stage
RUN echo bug_stage > foo/bug
RUN date > /date
COPY context/foo /foo
RUN echo hey