build: --iidfile support with buildkit#1176
Conversation
a35d6f8 to
65c2ba0
Compare
| return errors.Errorf("buildkit not supported by daemon") | ||
| } | ||
|
|
||
| if options.imageIDFile != "" { |
There was a problem hiding this comment.
I'm sure I'm missing some context for where this gets run, but this seems odd.
What if the user already has this file from a previous build and doesn't want it removed?
There was a problem hiding this comment.
@cpuguy83 this seems to be the behavior for old builder as well. The idea is to say, if we can't remove the file, we can't write to it, so fail early instead of running the whole successful build and then fail at writing the image id file.
|
|
||
| if options.imageIDFile != "" { | ||
| if imageID == "" { | ||
| return errors.Errorf("Server did not provide an image ID. Cannot write %s", options.imageIDFile) |
There was a problem hiding this comment.
"cannot write image ID file, server did not provide an image ID"
There was a problem hiding this comment.
@cpuguy83 as in you need to use it with moby/moby#37368
| } | ||
| imageID = strings.TrimSpace(imageID) | ||
| if err := ioutil.WriteFile(options.imageIDFile, []byte(imageID), 0666); err != nil { | ||
| return err |
There was a problem hiding this comment.
`errors.Wrap(err, "error writing image ID file")
4d016f1 to
8f43a9c
Compare
| close(displayCh) | ||
| }() | ||
| displayStatus(displayCh) | ||
| displayStatus(out, displayCh) |
| }) | ||
| } else { | ||
| displayStatus(t.displayCh) | ||
| displayStatus(out, t.displayCh) |
8f43a9c to
921d012
Compare
Signed-off-by: Tibor Vass <tibor@docker.com>
921d012 to
c7e85c0
Compare
|
LGTM |
Signed-off-by: Tibor Vass tibor@docker.com
To be tested with moby/moby#37368
This changes buildkit's output to Stdout instead of Stderr, to match the old builder behavior.