Replies: 1 comment
-
Isn't this enough? FROM ubuntu
RUN ...
RUN ...
RUN ...
FROM scratch
COPY --from=0 / / (Metadata like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now, the
squash
feature is experimental and also squash all layers into a single one.My suggestion is to add instructions in a
Dockerfile
on what to squash.Ex.: if I have a set of instructions like this:
A situation like this can easy gets unreadable and harder to change.
But with possible squash instructions, it could look like this:
This is easier to read, debug, and modify. The
SQUASH end
would only be executed if it's reached.Now I'm guessing that the one thing that could cause problems here is the fact that
SQUASH start
andSQUASH end
wouldn't act as layers per se.Possible behaviors:
SQUASH start
with noSQUASH end
: squash all layers afterSQUASH start
SQUASH end
with noSQUASH start
: errorSQUASH start
without anySQUASH end
between them: errorSQUASH start
without aSQUASH end
wouldn't impact other images using this one as a baseSQUASH end
is not reached because some instructions failed, the work after theSQUASH start
is cached for faster rebuilds while debuggingBeta Was this translation helpful? Give feedback.
All reactions