-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add initial "multi-stage" support in bashbrew #5929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yosifkit
merged 12 commits into
docker-library:master
from
infosiftr:bashbrew-multistage
Jun 13, 2019
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
67098be
Add initial "multi-stage" support in bashbrew
tianon f6d9672
Update "naughty-from.sh" to support multi-stage
tianon 81e8f4f
Unexpose "DockerfileMetadata" and add new exposed "DockerFroms" (sinc…
tianon a898c73
Remove "DockerFrom" function entirely to cause scripts to fail and fo…
tianon e1a94ef
Update "diff-pr.sh" to use the new DockerFroms function
tianon 0ef77ba
Add new "ArchLastStageFrom" function for getting the effective "base"…
tianon 828b8ba
Drop "ADD --from=" (which isn't supported by Docker)
tianon 1f2cab5
Improve Dockerfile fetching error reporting and "bashbrew children" /…
tianon 8969734
Apply gofmt
tianon 9cd890f
Remove "apply-constraints" from Travis to make the test more useful (…
tianon 22c68d5
Switch most "git" operations over to https://github.com/src-d/go-git …
tianon bcc52e4
Add new script to also verify "Constraints:" values are correct
tianon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this catch is worth pointing out explicitly here too -- we don't ever have a "local" copy of the context, and instead stream
git archive
directly todocker build
, so even ifdocker build --target=N
were possible to do for a numbered stage, we'd still have an optimization problem implementing it (and I'd love to at least tag named stages that way, but thegit archive | docker build
optimization makes that a little harder to swallow).The practical implication of this is that build cache for these untagged stages will still be considered "ripe" by our tooling and thus we will end up spending extra time rebuilding things after each cleaning of "ripe" images on our build servers.
For this reason, I think that for the official images, we should plan to still discourage multi-stage image use unless the gains are clear and/or the final artifacts are reproducible (and thus can avoid unnecessary image updates), and even then encourage use of explicitly named stages so that we can hopefully tag them in the future to help avoid this issue.