-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
Sometimes a cleanup can be skipped between stages, even squashing can't take all optimizations because we need to save the stage/files at the end. But we can just tell to the first stage to not clean the fs and to the following stage that the filesystem is intact. This has the same effect as squashing but can be more generally applied.
FROM debian:12.10 AS first-stage
UNPACK debian:12.10
SAVE STAGE /kaniko/stages/0
- CLEAN
FROM first-stage AS third-stage
- UNPACK /kaniko/stages/0
RUN touch test
SAVE FILES [test] /kaniko/deps/2
CLEAN
FROM first-stage AS fifth-stage
UNPACK /kaniko/stages/0
COPY --from=third-stage test testReactions are currently unavailable