[dockerfile2llb] fix daemon crash: check for circular dependency in convert#999
Merged
tonistiigi merged 4 commits intomoby:masterfrom May 12, 2019
Merged
[dockerfile2llb] fix daemon crash: check for circular dependency in convert#999tonistiigi merged 4 commits intomoby:masterfrom
tonistiigi merged 4 commits intomoby:masterfrom
Conversation
Member
|
AkihiroSuda
reviewed
May 11, 2019
| return false | ||
| } | ||
|
|
||
| func hasCircularDependency(states []*dispatchState) (bool, *dispatchState) { |
Contributor
Author
There was a problem hiding this comment.
sure, added "TestDockerfileCircularDependencies"
AkihiroSuda
reviewed
May 11, 2019
| visited := make(map[*dispatchState]struct{}) | ||
| path := make(map[*dispatchState]struct{}) | ||
|
|
||
| visit = func (state *dispatchState) bool { |
Contributor
Author
There was a problem hiding this comment.
visit is called recursively, I get "undefined: visit" when using " := "; this is the go's order of evaluation
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
… dependency To have stageName in error output in case one stage depends on itself Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
Signed-off-by: Stepan Blyshchak <stepanblischak@gmail.com>
1e6367b to
ea4bb02
Compare
AkihiroSuda
approved these changes
May 12, 2019
tonistiigi
approved these changes
May 12, 2019
Member
|
Thanks @Blyschak |
Member
|
This should be back ported to Docker 18.09? |
Contributor
Author
|
@AkihiroSuda I have no specific wish to back port it to 18.09, so only if you want |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Signed-off-by: Stepan Blyshchak stepanblischak@gmail.com
By creating a simple dockerfile like this:
and building using following command:
DOCKER_BUILDKIT=1 /usr/bin/docker build -t test .
dockerd crashes (part of log):
Interestingly that dockerfile:
does not crashes that daemon however there is a cyclic dependency on stages and IMO resulted image is undefined.
Lagacy builder with same dockerfile fails with a another error:
I have added a check for circular dependency after convert fills all dependencies in, so now I get: