mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-17 23:25:32 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user