浏览代码

Merge pull request #1012 from chris-crone/bump-buildx

Bump buildx and docker vendoring
Chris Crone 4 年之前
父节点
当前提交
59a94a0a8e
共有 3 个文件被更改,包括 431 次插入148 次删除
  1. 15 24
      go.mod
  2. 409 123
      go.sum
  3. 7 1
      local/compose/build.go

+ 15 - 24
go.mod

@@ -2,20 +2,6 @@ module github.com/docker/compose-cli
 
 go 1.15
 
-// the distribution version from ecs plugin is quite old and it breaks containerd
-// we need to create a new release tag for docker/distribution
-replace github.com/docker/distribution => github.com/docker/distribution v0.0.0-20200708230824-53e18a9d9bfe
-
-// (for buildx)
-replace github.com/containerd/containerd => github.com/containerd/containerd v1.3.1-0.20200227195959-4d242818bf55
-
-replace github.com/docker/docker => github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible
-
-replace github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305
-
-// unix.SYS_IOCTL has been removed from golang/sys but still in use by docker/docker until 20.x
-replace golang.org/x/sys => golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6
-
 require (
 	github.com/AlecAivazis/survey/v2 v2.2.3
 	github.com/Azure/azure-sdk-for-go v48.2.0+incompatible
@@ -26,21 +12,18 @@ require (
 	github.com/Azure/go-autorest/autorest/azure/cli v0.4.2
 	github.com/Azure/go-autorest/autorest/date v0.3.0
 	github.com/Azure/go-autorest/autorest/to v0.4.0
-	github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
 	github.com/Microsoft/go-winio v0.4.15
-	github.com/Microsoft/hcsshim v0.8.10 // indirect
 	github.com/aws/aws-sdk-go v1.35.33
 	github.com/awslabs/goformation/v4 v4.15.6
 	github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129
 	github.com/compose-spec/compose-go v0.0.0-20201210155915-b5ef325e9175
 	github.com/containerd/console v1.0.1
-	github.com/containerd/containerd v1.4.0-0
+	github.com/containerd/containerd v1.4.3
 	github.com/containerd/continuity v0.0.0-20200928162600-f2cc35102c2a // indirect
-	github.com/docker/buildx v0.4.2
-	github.com/docker/cli v0.0.0-20200528204125-dd360c7c0de8
-	github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
-	github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible
-	github.com/docker/docker-credential-helpers v0.6.3 // indirect
+	github.com/docker/buildx v0.5.0-rc1
+	github.com/docker/cli v20.10.0+incompatible
+	github.com/docker/distribution v2.7.1+incompatible
+	github.com/docker/docker v20.10.0+incompatible
 	github.com/docker/go-connections v0.4.0
 	github.com/docker/go-units v0.4.0
 	github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee // indirect
@@ -49,13 +32,13 @@ require (
 	github.com/golang/mock v1.4.4
 	github.com/golang/protobuf v1.4.3
 	github.com/google/go-cmp v0.5.4
-	github.com/gorilla/mux v1.7.4 // indirect
 	github.com/hashicorp/go-multierror v1.1.0
 	github.com/hashicorp/go-uuid v1.0.2
 	github.com/iancoleman/strcase v0.1.2
 	github.com/joho/godotenv v1.3.0
 	github.com/labstack/echo v3.3.10+incompatible
 	github.com/labstack/gommon v0.3.0 // indirect
+	github.com/moby/buildkit v0.8.1-0.20201205083753-0af7b1b9c693
 	github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf
 	github.com/morikuni/aec v1.0.0
 	github.com/opencontainers/go-digest v1.0.0
@@ -74,8 +57,16 @@ require (
 	golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
 	google.golang.org/grpc v1.33.2
 	google.golang.org/protobuf v1.25.0
-	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
 	gopkg.in/ini.v1 v1.62.0
 	gotest.tools v2.2.0+incompatible
 	gotest.tools/v3 v3.0.3
 )
+
+replace (
+	// the distribution version from ecs plugin is quite old and it breaks containerd
+	// we need to create a new release tag for docker/distribution
+	github.com/docker/distribution => github.com/docker/distribution v0.0.0-20200708230824-53e18a9d9bfe
+
+	// (for buildx)
+	github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305
+)

文件差异内容过多而无法显示
+ 409 - 123
go.sum


+ 7 - 1
local/compose/build.go

@@ -29,6 +29,7 @@ import (
 	_ "github.com/docker/buildx/driver/docker" // required to get default driver registered
 	"github.com/docker/buildx/util/progress"
 	"github.com/docker/docker/errdefs"
+	bclient "github.com/moby/buildkit/client"
 )
 
 func (s *composeService) Build(ctx context.Context, project *types.Project) error {
@@ -110,7 +111,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
 		return nil
 	}
 	const drivername = "default"
-	d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, nil, nil, "", nil, project.WorkingDir)
+	d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, nil, nil, nil, "", nil, project.WorkingDir)
 	if err != nil {
 		return err
 	}
@@ -130,6 +131,10 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
 
 	// We rely on buildx "docker" builder integrated in docker engine, so don't need a DockerAPI here
 	_, err = build.Build(ctx, driverInfo, opts, nil, nil, w)
+	errW := w.Wait()
+	if err == nil {
+		err = errW
+	}
 	return err
 }
 
@@ -150,6 +155,7 @@ func (s *composeService) toBuildOptions(service types.ServiceConfig, contextPath
 		BuildArgs: flatten(mergeArgs(service.Build.Args, buildArgs)),
 		Tags:      tags,
 		Target:    service.Build.Target,
+		Exports:   []bclient.ExportEntry{{Type: "image", Attrs: map[string]string{}}},
 	}
 }
 

部分文件因为文件数量过多而无法显示