Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
656fe85
build: add experimental buildkit base
tonistiigi Apr 18, 2018
0f97642
build: basic buildkit progress support
tonistiigi Apr 19, 2018
b19294e
system: add buildcache formatting
tonistiigi May 18, 2018
8cf213b
build: use a separate upload request for early progress
tonistiigi May 19, 2018
e0b3921
build: Add support for using context from stdin with buildkit
May 19, 2018
5314a8f
build: Add support for using dockerfile from stdin with buildkit
May 22, 2018
89e1024
build: error out if buildkit is on and stdin is used for both dockerf…
May 22, 2018
82f0e1e
build: fix `-f` handling with buildkit
May 23, 2018
640cbb8
build: fix output handling with buildkit (quiet option, redirects)
May 24, 2018
b2b3f9c
build: setting DOCKER_BUILDKIT environment variable to any non-empty …
Jun 5, 2018
584d59d
formatter: fix TestDiskUsageContextFormatWrite expected output
Jun 6, 2018
ed75f62
build: add experimental --no-console flag to support non-tty human-re…
Jun 9, 2018
15674d9
build: simplify Close logic in WriteTempDockerfile
Jun 9, 2018
5919e8a
build: fix lint issues + refactor
Jun 9, 2018
aef4209
build: skip moby.buildkit.trace Aux message to be future proof
Jun 9, 2018
8945270
vendor: update buildkit and fsutil
tonistiigi Jun 10, 2018
6c60bb4
vendor: update docker/docker to c752b0991e31ba9869ab6a0661af57e9423874fb
Jun 12, 2018
00792d1
build: ensure temporary folder is removed in error case
Jun 13, 2018
5a103e1
build: change --no-console to --console=[true|false|auto]
Jun 13, 2018
b3a5c15
build: address some review nits
Jun 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
build: address some review nits
Signed-off-by: Tibor Vass <[email protected]>
  • Loading branch information
Tibor Vass committed Jun 13, 2018
commit b3a5c153d51a54bced68ec41a682ef74b9d9a61d
2 changes: 1 addition & 1 deletion cli/command/formatter/disk_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (c *diskUsageBuilderContext) Size() string {
}

func (c *diskUsageBuilderContext) Reclaimable() string {
inUseBytes := int64(0)
var inUseBytes int64
for _, bc := range c.buildCache {
if bc.InUse {
inUseBytes += bc.Size
Expand Down
1 change: 1 addition & 0 deletions cli/command/image/build/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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

dockerfileDir, err = ioutil.TempDir("", "docker-build-tempdockerfile-")
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consider renaming the err output var, to prevent it from being confused with local vars (we ran into a couple of cases where this was overlooked in code changes)

if err != nil {
return "", errors.Errorf("unable to create temporary context directory: %v", err)
Expand Down
22 changes: 5 additions & 17 deletions cli/command/image/build_buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error {
return errors.Errorf("buildkit not supported by daemon")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make trysession return this error?

}

buildID := stringid.GenerateRandomID()

var (
remote string
body io.Reader
Expand Down Expand Up @@ -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)
Expand All @@ -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{
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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)

}

Expand All @@ -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
}
Expand Down