-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: history should not contain ARG values
It seems docker never writes ARG values to build history and only writes values with RUN statements. As a result it can utilize caching better if assgnment of an ARG value is never used. Instance ```Dockerfile FROM alpine ARG FOO ENV FOO=bat RUN echo $FOO ``` In above example --build-arg FOO=value has no significance as value is always overriden by ENV. Following PR makes sure buildah mimics a similar behaviour. Signed-off-by: Aditya Rajan <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM alpine | ||
ARG FOO | ||
ENV FOO=bat | ||
RUN echo $FOO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM alpine | ||
ARG FOO | ||
ENV FOO=${FOO} | ||
RUN echo $FOO |