-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support for experimental BuildKit #1111
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
Changes from 1 commit
656fe85
0f97642
b19294e
8cf213b
e0b3921
5314a8f
89e1024
82f0e1e
640cbb8
b2b3f9c
584d59d
ed75f62
15674d9
5919e8a
aef4209
8945270
6c60bb4
00792d1
5a103e1
b3a5c15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Tibor Vass <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,7 @@ func DetectArchiveReader(input io.ReadCloser) (rc io.ReadCloser, isArchive bool, | |
| // name specified by DefaultDockerfileName and returns the path to the | ||
| // temporary directory containing the Dockerfile. | ||
| func WriteTempDockerfile(rc io.ReadCloser) (dockerfileDir string, err error) { | ||
| // err is a named return value, due to the defer call below. | ||
| dockerfileDir, err = ioutil.TempDir("", "docker-build-tempdockerfile-") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. error management in this function seem more complicated than necessary. As the err output parameter is named, why not use a single defer block to centralize error reporting ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: consider renaming the |
||
| if err != nil { | ||
| return "", errors.Errorf("unable to create temporary context directory: %v", err) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,8 +43,6 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error { | |
| return errors.Errorf("buildkit not supported by daemon") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make |
||
| } | ||
|
|
||
| buildID := stringid.GenerateRandomID() | ||
|
|
||
| var ( | ||
| remote string | ||
| body io.Reader | ||
|
|
@@ -118,13 +116,6 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error { | |
| })) | ||
| } | ||
|
|
||
| // statusContext, cancelStatus := context.WithCancel(ctx) | ||
| // defer cancelStatus() | ||
|
|
||
| // if span := opentracing.SpanFromContext(ctx); span != nil { | ||
| // statusContext = opentracing.ContextWithSpan(statusContext, span) | ||
| // } | ||
|
|
||
| s.Allow(authprovider.NewDockerAuthProvider()) | ||
|
|
||
| eg, ctx := errgroup.WithContext(ctx) | ||
|
|
@@ -133,6 +124,7 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error { | |
| return s.Run(context.TODO(), dockerCli.Client().DialSession) | ||
| }) | ||
|
|
||
| buildID := stringid.GenerateRandomID() | ||
| if body != nil { | ||
| eg.Go(func() error { | ||
| buildOptions := types.ImageBuildOptions{ | ||
|
|
@@ -233,20 +225,15 @@ func doBuild(ctx context.Context, eg *errgroup.Group, dockerCli command.Cli, opt | |
| if jerr.Code == 0 { | ||
| jerr.Code = 1 | ||
| } | ||
| // if options.quiet { | ||
| // fmt.Fprintf(dockerCli.Err(), "%s%s", progBuff, buildBuff) | ||
| // } | ||
| return cli.StatusError{Status: jerr.Message, StatusCode: jerr.Code} | ||
| } | ||
| return err | ||
| } | ||
|
|
||
| return nil | ||
| return err | ||
| } | ||
|
|
||
| func resetUIDAndGID(s *fsutil.Stat) bool { | ||
| s.Uid = uint32(0) | ||
| s.Gid = uint32(0) | ||
| s.Uid = 0 | ||
| s.Gid = 0 | ||
| return true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was wondering why the boolean return was here, but guess this is to satisfy an interface? (reading from my phone so couldn't check easily) |
||
| } | ||
|
|
||
|
|
@@ -268,6 +255,7 @@ func (t *tracer) write(msg jsonmessage.JSONMessage) { | |
| } | ||
|
|
||
| var dt []byte | ||
| // ignoring all messages that are not understood | ||
| if err := json.Unmarshal(*msg.Aux, &dt); err != nil { | ||
| return | ||
| } | ||
|
|
||
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.
was thinking naming it
retErr(eg), but just a nit; no need to change