Skip to content

Commit c665c53

Browse files
gloursndeloof
authored andcommitted
bump buildx to v0.12.0 and adapt code to changes
Signed-off-by: Guillaume Lours <[email protected]>
1 parent a1aceba commit c665c53

File tree

8 files changed

+61
-147
lines changed

8 files changed

+61
-147
lines changed

cmd/compose/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525
"github.com/compose-spec/compose-go/cli"
2626
"github.com/compose-spec/compose-go/loader"
2727
"github.com/compose-spec/compose-go/types"
28-
buildx "github.com/docker/buildx/util/progress"
2928
"github.com/docker/cli/cli/command"
3029
cliopts "github.com/docker/cli/opts"
3130
ui "github.com/docker/compose/v2/pkg/progress"
31+
buildkit "github.com/moby/buildkit/util/progress/progressui"
3232
"github.com/spf13/cobra"
3333

3434
"github.com/docker/compose/v2/pkg/api"
@@ -118,7 +118,7 @@ func buildCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service)
118118
cmd.Flags().Bool("no-rm", false, "Do not remove intermediate containers after a successful build. DEPRECATED")
119119
cmd.Flags().MarkHidden("no-rm") //nolint:errcheck
120120
cmd.Flags().VarP(&opts.memory, "memory", "m", "Set memory limit for the build container. Not supported by BuildKit.")
121-
cmd.Flags().StringVar(&p.Progress, "progress", buildx.PrinterModeAuto, fmt.Sprintf(`Set type of ui output (%s)`, strings.Join(printerModes, ", ")))
121+
cmd.Flags().StringVar(&p.Progress, "progress", string(buildkit.AutoMode), fmt.Sprintf(`Set type of ui output (%s)`, strings.Join(printerModes, ", ")))
122122
cmd.Flags().MarkHidden("progress") //nolint:errcheck
123123

124124
return cmd

cmd/compose/compose.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ import (
3232
"github.com/compose-spec/compose-go/types"
3333
composegoutils "github.com/compose-spec/compose-go/utils"
3434
"github.com/docker/buildx/util/logutil"
35-
buildx "github.com/docker/buildx/util/progress"
3635
dockercli "github.com/docker/cli/cli"
3736
"github.com/docker/cli/cli-plugins/manager"
3837
"github.com/docker/cli/cli/command"
3938
"github.com/docker/compose/v2/pkg/remote"
39+
buildkit "github.com/moby/buildkit/util/progress/progressui"
4040
"github.com/morikuni/aec"
4141
"github.com/sirupsen/logrus"
4242
"github.com/spf13/cobra"
@@ -163,7 +163,7 @@ func (o *ProjectOptions) addProjectFlags(f *pflag.FlagSet) {
163163
f.StringVar(&o.ProjectDir, "project-directory", "", "Specify an alternate working directory\n(default: the path of the, first specified, Compose file)")
164164
f.StringVar(&o.WorkDir, "workdir", "", "DEPRECATED! USE --project-directory INSTEAD.\nSpecify an alternate working directory\n(default: the path of the, first specified, Compose file)")
165165
f.BoolVar(&o.Compatibility, "compatibility", false, "Run compose in backward compatibility mode")
166-
f.StringVar(&o.Progress, "progress", buildx.PrinterModeAuto, fmt.Sprintf(`Set type of progress output (%s)`, strings.Join(printerModes, ", ")))
166+
f.StringVar(&o.Progress, "progress", string(buildkit.AutoMode), fmt.Sprintf(`Set type of progress output (%s)`, strings.Join(printerModes, ", ")))
167167
_ = f.MarkHidden("workdir")
168168
}
169169

cmd/compose/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"fmt"
2222
"strings"
2323

24-
xprogress "github.com/docker/buildx/util/progress"
24+
xprogress "github.com/moby/buildkit/util/progress/progressui"
2525

2626
cgo "github.com/compose-spec/compose-go/cli"
2727
"github.com/compose-spec/compose-go/loader"
@@ -157,7 +157,7 @@ func runCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service) *
157157
}
158158

159159
if createOpts.quietPull {
160-
buildOpts.Progress = xprogress.PrinterModeQuiet
160+
buildOpts.Progress = string(xprogress.QuietMode)
161161
}
162162

163163
options.ignoreOrphans = utils.StringToBool(project.Environment[ComposeIgnoreOrphans])

cmd/compose/up.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strings"
2424
"time"
2525

26-
xprogress "github.com/docker/buildx/util/progress"
26+
xprogress "github.com/moby/buildkit/util/progress/progressui"
2727

2828
"github.com/compose-spec/compose-go/types"
2929
"github.com/docker/cli/cli/command"
@@ -181,7 +181,7 @@ func runUp(
181181
// already removed all the build sections
182182
if !createOptions.noBuild {
183183
if createOptions.quietPull {
184-
buildOptions.Progress = xprogress.PrinterModeQuiet
184+
buildOptions.Progress = string(xprogress.QuietMode)
185185
}
186186
// BuildOptions here is nested inside CreateOptions, so
187187
// no service list is passed, it will implicitly pick all

go.mod

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/containerd/containerd v1.7.7
1212
github.com/davecgh/go-spew v1.1.1
1313
github.com/distribution/reference v0.5.0
14-
github.com/docker/buildx v0.11.2
14+
github.com/docker/buildx v0.12.0
1515
github.com/docker/cli v24.0.7+incompatible
1616
github.com/docker/cli-docs-tool v0.6.0
1717
github.com/docker/docker v24.0.7+incompatible
@@ -25,7 +25,7 @@ require (
2525
github.com/jonboulle/clockwork v0.4.0
2626
github.com/mattn/go-shellwords v1.0.12
2727
github.com/mitchellh/mapstructure v1.5.0
28-
github.com/moby/buildkit v0.12.3
28+
github.com/moby/buildkit v0.13.0-beta1.0.20231023114302-d5c1d785b042
2929
github.com/moby/patternmatcher v0.6.0
3030
github.com/moby/term v0.5.0
3131
github.com/morikuni/aec v1.0.0
@@ -56,7 +56,6 @@ require (
5656
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
5757
github.com/Masterminds/semver/v3 v3.2.1 // indirect
5858
github.com/Microsoft/hcsshim v0.11.1 // indirect
59-
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
6059
github.com/aws/aws-sdk-go-v2 v1.17.6 // indirect
6160
github.com/aws/aws-sdk-go-v2/config v1.18.16 // indirect
6261
github.com/aws/aws-sdk-go-v2/credentials v1.13.16 // indirect
@@ -88,7 +87,6 @@ require (
8887
github.com/go-openapi/jsonreference v0.20.0 // indirect
8988
github.com/go-openapi/swag v0.19.14 // indirect
9089
github.com/gofrs/flock v0.8.1 // indirect
91-
github.com/gofrs/uuid v4.2.0+incompatible // indirect
9290
github.com/gogo/googleapis v1.4.1 // indirect
9391
github.com/gogo/protobuf v1.3.2 // indirect
9492
github.com/golang/protobuf v1.5.3 // indirect
@@ -99,7 +97,7 @@ require (
9997
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
10098
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
10199
github.com/hashicorp/errwrap v1.1.0 // indirect
102-
github.com/hashicorp/hcl v1.0.0 // indirect
100+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
103101
github.com/imdario/mergo v0.3.16 // indirect
104102
github.com/in-toto/in-toto-golang v0.5.0 // indirect
105103
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -123,9 +121,8 @@ require (
123121
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
124122
github.com/modern-go/reflect2 v1.0.2 // indirect
125123
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
126-
github.com/opencontainers/runc v1.1.7 // indirect
124+
github.com/opencontainers/runc v1.1.9 // indirect
127125
github.com/pelletier/go-toml v1.9.5 // indirect
128-
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
129126
github.com/pkg/errors v0.9.1 // indirect
130127
github.com/pmezard/go-difflib v1.0.0 // indirect
131128
github.com/prometheus/client_golang v1.14.0 // indirect
@@ -136,8 +133,6 @@ require (
136133
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
137134
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 // indirect
138135
github.com/shibumi/go-pathspec v1.3.0 // indirect
139-
github.com/spf13/afero v1.9.2 // indirect
140-
github.com/subosito/gotenv v1.4.1 // indirect
141136
github.com/tonistiigi/fsutil v0.0.0-20230629203738-36ef4d8c0dbb // indirect
142137
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
143138
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
@@ -151,12 +146,12 @@ require (
151146
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 // indirect
152147
go.opentelemetry.io/otel/metric v0.37.0 // indirect
153148
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
154-
golang.org/x/crypto v0.12.0 // indirect
149+
golang.org/x/crypto v0.14.0 // indirect
155150
golang.org/x/mod v0.11.0 // indirect
156-
golang.org/x/net v0.14.0 // indirect
151+
golang.org/x/net v0.17.0 // indirect
157152
golang.org/x/oauth2 v0.11.0 // indirect
158-
golang.org/x/term v0.11.0 // indirect
159-
golang.org/x/text v0.12.0 // indirect
153+
golang.org/x/term v0.13.0 // indirect
154+
golang.org/x/text v0.13.0 // indirect
160155
golang.org/x/time v0.3.0 // indirect
161156
golang.org/x/tools v0.7.0 // indirect
162157
google.golang.org/appengine v1.6.7 // indirect
@@ -165,12 +160,11 @@ require (
165160
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
166161
google.golang.org/protobuf v1.31.0 // indirect
167162
gopkg.in/inf.v0 v0.9.1 // indirect
168-
gopkg.in/ini.v1 v1.67.0 // indirect
169163
gopkg.in/yaml.v2 v2.4.0 // indirect
170164
gopkg.in/yaml.v3 v3.0.1 // indirect
171-
k8s.io/api v0.26.2 // indirect
172-
k8s.io/apimachinery v0.26.2 // indirect
173-
k8s.io/client-go v0.26.2 // indirect
165+
k8s.io/api v0.26.7 // indirect
166+
k8s.io/apimachinery v0.26.7 // indirect
167+
k8s.io/client-go v0.26.7 // indirect
174168
k8s.io/klog/v2 v2.90.1 // indirect
175169
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
176170
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect

0 commit comments

Comments
 (0)