Skip to content

Commit cf2fc20

Browse files
thaJeztahndeloof
andcommitted
go.mod: docker/docker, docker/cli v28.0.0, buildx v0.21.1
full diff: - moby/moby@v27.5.1...v28.0.0 - docker/cli@v27.5.1...v28.0.0 - docker/buildx@v0.20.1...v0.21.1 Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d0398a4 commit cf2fc20

40 files changed

Lines changed: 417 additions & 382 deletions

cmd/formatter/container.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/docker/cli/cli/command/formatter"
2626
"github.com/docker/compose/v2/pkg/api"
27-
"github.com/docker/docker/api/types"
27+
"github.com/docker/docker/api/types/container"
2828
"github.com/docker/docker/pkg/stringid"
2929
"github.com/docker/go-units"
3030
)
@@ -212,9 +212,9 @@ func (c *ContainerContext) Publishers() api.PortPublishers {
212212
}
213213

214214
func (c *ContainerContext) Ports() string {
215-
var ports []types.Port
215+
var ports []container.Port
216216
for _, publisher := range c.c.Publishers {
217-
ports = append(ports, types.Port{
217+
ports = append(ports, container.Port{
218218
IP: publisher.URL,
219219
PrivatePort: uint16(publisher.TargetPort),
220220
PublicPort: uint16(publisher.PublishedPort),

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ require (
1212
github.com/containerd/platforms v1.0.0-rc.1
1313
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
1414
github.com/distribution/reference v0.6.0
15-
github.com/docker/buildx v0.20.1
16-
github.com/docker/cli v27.5.1+incompatible
15+
github.com/docker/buildx v0.21.1
16+
github.com/docker/cli v28.0.0+incompatible
1717
github.com/docker/cli-docs-tool v0.9.0
18-
github.com/docker/docker v27.5.1+incompatible
18+
github.com/docker/docker v28.0.0+incompatible
1919
github.com/docker/go-connections v0.5.0
2020
github.com/docker/go-units v0.5.0
2121
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8Yc
127127
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
128128
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
129129
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
130-
github.com/docker/buildx v0.20.1 h1:q88EfoYwrWEKVqNb9stOFq8fUlFp/OPlDcFE+QUYZBM=
131-
github.com/docker/buildx v0.20.1/go.mod h1:VVi4Nvo4jd/IkRvwyExbIyW7u82fivK61MRx5I0oKic=
132-
github.com/docker/cli v27.5.1+incompatible h1:JB9cieUT9YNiMITtIsguaN55PLOHhBSz3LKVc6cqWaY=
133-
github.com/docker/cli v27.5.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
130+
github.com/docker/buildx v0.21.1 h1:YjV2k6CsSDbkDTOMsjARUIrj2xv+zZR+M2dtrRyzXhg=
131+
github.com/docker/buildx v0.21.1/go.mod h1:8V4UMnlKsaGYwz83BygmIbJIFEAYGHT6KAv8akDZmqo=
132+
github.com/docker/cli v28.0.0+incompatible h1:ido37VmLUqEp+5NFb9icd6BuBB+SNDgCn+5kPCr2buA=
133+
github.com/docker/cli v28.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
134134
github.com/docker/cli-docs-tool v0.9.0 h1:CVwQbE+ZziwlPqrJ7LRyUF6GvCA+6gj7MTCsayaK9t0=
135135
github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3Tr1ipoypjAUtc=
136136
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
137137
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
138138
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
139-
github.com/docker/docker v27.5.1+incompatible h1:4PYU5dnBYqRQi0294d1FBECqT9ECWeQAIfE8q4YnPY8=
140-
github.com/docker/docker v27.5.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
139+
github.com/docker/docker v28.0.0+incompatible h1:Olh0KS820sJ7nPsBKChVhk5pzqcwDR15fumfAd/p9hM=
140+
github.com/docker/docker v28.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
141141
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
142142
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
143143
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

internal/sync/tar.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
"github.com/hashicorp/go-multierror"
3434

35-
moby "github.com/docker/docker/api/types"
35+
"github.com/docker/docker/api/types/container"
3636
"github.com/docker/docker/pkg/archive"
3737
)
3838

@@ -43,7 +43,7 @@ type archiveEntry struct {
4343
}
4444

4545
type LowLevelClient interface {
46-
ContainersForService(ctx context.Context, projectName string, serviceName string) ([]moby.Container, error)
46+
ContainersForService(ctx context.Context, projectName string, serviceName string) ([]container.Summary, error)
4747

4848
Exec(ctx context.Context, containerID string, cmd []string, in io.Reader) error
4949
Untar(ctx context.Context, id string, reader io.ReadCloser) error

internal/tracing/attributes.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"time"
2626

2727
"github.com/compose-spec/compose-go/v2/types"
28-
moby "github.com/docker/docker/api/types"
28+
"github.com/docker/docker/api/types/container"
2929
"go.opentelemetry.io/otel/attribute"
3030
"go.opentelemetry.io/otel/trace"
3131
)
@@ -140,15 +140,15 @@ func ServiceOptions(service types.ServiceConfig) SpanOptions {
140140
// For convenience, it's returned as a SpanOptions object to allow it to be
141141
// passed directly to the wrapping helper methods in this package such as
142142
// SpanWrapFunc.
143-
func ContainerOptions(container moby.Container) SpanOptions {
143+
func ContainerOptions(ctr container.Summary) SpanOptions {
144144
attrs := []attribute.KeyValue{
145-
attribute.String("container.id", container.ID),
146-
attribute.String("container.image", container.Image),
147-
unixTimeAttr("container.created_at", container.Created),
145+
attribute.String("container.id", ctr.ID),
146+
attribute.String("container.image", ctr.Image),
147+
unixTimeAttr("container.created_at", ctr.Created),
148148
}
149149

150-
if len(container.Names) != 0 {
151-
attrs = append(attrs, attribute.String("container.name", strings.TrimPrefix(container.Names[0], "/")))
150+
if len(ctr.Names) != 0 {
151+
attrs = append(attrs, attribute.String("container.name", strings.TrimPrefix(ctr.Names[0], "/")))
152152
}
153153

154154
return []trace.SpanStartEventOption{

pkg/api/dryrunclient.go

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type DryRunKey struct{}
6060
// DryRunClient implements APIClient by delegating to implementation functions. This allows lazy init and per-method overrides
6161
type DryRunClient struct {
6262
apiClient client.APIClient
63-
containers []moby.Container
63+
containers []containerType.Summary
6464
execs sync.Map
6565
resolver *imagetools.Resolver
6666
}
@@ -82,7 +82,7 @@ func NewDryRunClient(apiClient client.APIClient, cli command.Cli) (*DryRunClient
8282
}
8383
return &DryRunClient{
8484
apiClient: apiClient,
85-
containers: []moby.Container{},
85+
containers: []containerType.Summary{},
8686
execs: sync.Map{},
8787
resolver: imagetools.New(configFile),
8888
}, nil
@@ -103,7 +103,7 @@ func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, op
103103
func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerType.Config, hostConfig *containerType.HostConfig,
104104
networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string,
105105
) (containerType.CreateResponse, error) {
106-
d.containers = append(d.containers, moby.Container{
106+
d.containers = append(d.containers, containerType.Summary{
107107
ID: containerName,
108108
Names: []string{containerName},
109109
Labels: config.Labels,
@@ -115,7 +115,7 @@ func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerTyp
115115
return containerType.CreateResponse{ID: containerName}, nil
116116
}
117117

118-
func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (moby.ContainerJSON, error) {
118+
func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (containerType.InspectResponse, error) {
119119
containerJSON, err := d.apiClient.ContainerInspect(ctx, container)
120120
if err != nil {
121121
id := "dryRunId"
@@ -124,20 +124,20 @@ func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (
124124
id = container
125125
}
126126
}
127-
return moby.ContainerJSON{
128-
ContainerJSONBase: &moby.ContainerJSONBase{
127+
return containerType.InspectResponse{
128+
ContainerJSONBase: &containerType.ContainerJSONBase{
129129
ID: id,
130130
Name: container,
131-
State: &moby.ContainerState{
131+
State: &containerType.State{
132132
Status: "running", // needed for --wait option
133-
Health: &moby.Health{
134-
Status: moby.Healthy, // needed for healthcheck control
133+
Health: &containerType.Health{
134+
Status: containerType.Healthy, // needed for healthcheck control
135135
},
136136
},
137137
},
138138
Mounts: nil,
139139
Config: &containerType.Config{},
140-
NetworkSettings: &moby.NetworkSettings{},
140+
NetworkSettings: &containerType.NetworkSettings{},
141141
}, nil
142142
}
143143
return containerJSON, err
@@ -147,7 +147,7 @@ func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal stri
147147
return nil
148148
}
149149

150-
func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]moby.Container, error) {
150+
func (d *DryRunClient) ContainerList(ctx context.Context, options containerType.ListOptions) ([]containerType.Summary, error) {
151151
caller := getCallingFunction()
152152
switch caller {
153153
case "start":
@@ -222,16 +222,26 @@ func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options
222222
}, nil
223223
}
224224

225-
func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (moby.ImageInspect, []byte, error) {
225+
func (d *DryRunClient) ImageInspect(ctx context.Context, imageName string, options ...client.ImageInspectOption) (image.InspectResponse, error) {
226226
caller := getCallingFunction()
227227
switch caller {
228228
case "pullServiceImage", "buildContainerVolumes":
229-
return moby.ImageInspect{ID: "dryRunId"}, nil, nil
229+
return image.InspectResponse{ID: "dryRunId"}, nil
230230
default:
231-
return d.apiClient.ImageInspectWithRaw(ctx, imageName)
231+
return d.apiClient.ImageInspect(ctx, imageName, options...)
232232
}
233233
}
234234

235+
// Deprecated: Use [DryRunClient.ImageInspect] instead; raw response can be obtained by [client.ImageInspectWithRawResponse] option.
236+
func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (image.InspectResponse, []byte, error) {
237+
var buf bytes.Buffer
238+
resp, err := d.ImageInspect(ctx, imageName, client.ImageInspectWithRawResponse(&buf))
239+
if err != nil {
240+
return image.InspectResponse{}, nil, err
241+
}
242+
return resp, buf.Bytes(), err
243+
}
244+
235245
func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) {
236246
if _, _, err := d.resolver.Resolve(ctx, ref); err != nil {
237247
return nil, err
@@ -299,15 +309,15 @@ func (d *DryRunClient) VolumeRemove(ctx context.Context, volumeID string, force
299309
return nil
300310
}
301311

302-
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config containerType.ExecOptions) (moby.IDResponse, error) {
312+
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config containerType.ExecOptions) (containerType.ExecCreateResponse, error) {
303313
b := make([]byte, 32)
304314
_, _ = rand.Read(b)
305315
id := fmt.Sprintf("%x", b)
306316
d.execs.Store(id, execDetails{
307317
container: container,
308318
command: config.Cmd,
309319
})
310-
return moby.IDResponse{
320+
return containerType.ExecCreateResponse{
311321
ID: id,
312322
}, nil
313323
}
@@ -344,7 +354,7 @@ func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swar
344354
return d.apiClient.ConfigUpdate(ctx, id, version, config)
345355
}
346356

347-
func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options containerType.CommitOptions) (moby.IDResponse, error) {
357+
func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options containerType.CommitOptions) (containerType.CommitResponse, error) {
348358
return d.apiClient.ContainerCommit(ctx, container, options)
349359
}
350360

@@ -368,7 +378,7 @@ func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (i
368378
return d.apiClient.ContainerExport(ctx, container)
369379
}
370380

371-
func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (moby.ContainerJSON, []byte, error) {
381+
func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (containerType.InspectResponse, []byte, error) {
372382
return d.apiClient.ContainerInspectWithRaw(ctx, container, getSize)
373383
}
374384

@@ -392,11 +402,11 @@ func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container stri
392402
return d.apiClient.ContainerStatsOneShot(ctx, container)
393403
}
394404

395-
func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.ContainerTopOKBody, error) {
405+
func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.TopResponse, error) {
396406
return d.apiClient.ContainerTop(ctx, container, arguments)
397407
}
398408

399-
func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.ContainerUpdateOKBody, error) {
409+
func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.UpdateResponse, error) {
400410
return d.apiClient.ContainerUpdate(ctx, container, updateConfig)
401411
}
402412

@@ -424,8 +434,8 @@ func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string,
424434
return d.apiClient.ImageCreate(ctx, parentReference, options)
425435
}
426436

427-
func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string) ([]image.HistoryResponseItem, error) {
428-
return d.apiClient.ImageHistory(ctx, imageName)
437+
func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string, options ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error) {
438+
return d.apiClient.ImageHistory(ctx, imageName, options...)
429439
}
430440

431441
func (d *DryRunClient) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) {
@@ -436,16 +446,16 @@ func (d *DryRunClient) ImageList(ctx context.Context, options image.ListOptions)
436446
return d.apiClient.ImageList(ctx, options)
437447
}
438448

439-
func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (image.LoadResponse, error) {
440-
return d.apiClient.ImageLoad(ctx, input, quiet)
449+
func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, options ...client.ImageLoadOption) (image.LoadResponse, error) {
450+
return d.apiClient.ImageLoad(ctx, input, options...)
441451
}
442452

443453
func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error) {
444454
return d.apiClient.ImageSearch(ctx, term, options)
445455
}
446456

447-
func (d *DryRunClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) {
448-
return d.apiClient.ImageSave(ctx, images)
457+
func (d *DryRunClient) ImageSave(ctx context.Context, images []string, options ...client.ImageSaveOption) (io.ReadCloser, error) {
458+
return d.apiClient.ImageSave(ctx, images, options...)
449459
}
450460

451461
func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error {

pkg/compose/attach.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525

2626
"github.com/compose-spec/compose-go/v2/types"
2727
"github.com/docker/cli/cli/streams"
28-
moby "github.com/docker/docker/api/types"
2928
containerType "github.com/docker/docker/api/types/container"
3029
"github.com/docker/docker/pkg/stdcopy"
3130
"github.com/moby/term"
@@ -52,16 +51,16 @@ func (s *composeService) attach(ctx context.Context, project *types.Project, lis
5251

5352
_, _ = fmt.Fprintf(s.stdout(), "Attaching to %s\n", strings.Join(names, ", "))
5453

55-
for _, container := range containers {
56-
err := s.attachContainer(ctx, container, listener)
54+
for _, ctr := range containers {
55+
err := s.attachContainer(ctx, ctr, listener)
5756
if err != nil {
5857
return nil, err
5958
}
6059
}
6160
return containers, err
6261
}
6362

64-
func (s *composeService) attachContainer(ctx context.Context, container moby.Container, listener api.ContainerEventListener) error {
63+
func (s *composeService) attachContainer(ctx context.Context, container containerType.Summary, listener api.ContainerEventListener) error {
6564
serviceName := container.Labels[api.ServiceLabel]
6665
containerName := getContainerNameWithoutProject(container)
6766

pkg/compose/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (s *composeService) getLocalImagesDigests(ctx context.Context, project *typ
340340
if err != nil {
341341
return nil, err
342342
}
343-
inspect, _, err := s.apiClient().ImageInspectWithRaw(ctx, digest)
343+
inspect, err := s.apiClient().ImageInspect(ctx, digest)
344344
if err != nil {
345345
return nil, err
346346
}
@@ -436,7 +436,7 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
436436
return build.Options{}, err
437437
}
438438
if service.Build.Privileged {
439-
allow = append(allow, entitlements.EntitlementSecurityInsecure)
439+
allow = append(allow, entitlements.EntitlementSecurityInsecure.String())
440440
}
441441

442442
imageLabels := getImageBuildLabels(project, service)

pkg/compose/commit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/docker/compose/v2/pkg/api"
2525
"github.com/docker/compose/v2/pkg/progress"
26-
containerType "github.com/docker/docker/api/types/container"
26+
"github.com/docker/docker/api/types/container"
2727
)
2828

2929
func (s *composeService) Commit(ctx context.Context, projectName string, options api.CommitOptions) error {
@@ -35,7 +35,7 @@ func (s *composeService) Commit(ctx context.Context, projectName string, options
3535
func (s *composeService) commit(ctx context.Context, projectName string, options api.CommitOptions) error {
3636
projectName = strings.ToLower(projectName)
3737

38-
container, err := s.getSpecifiedContainer(ctx, projectName, oneOffInclude, false, options.Service, options.Index)
38+
ctr, err := s.getSpecifiedContainer(ctx, projectName, oneOffInclude, false, options.Service, options.Index)
3939
if err != nil {
4040
return err
4141
}
@@ -44,7 +44,7 @@ func (s *composeService) commit(ctx context.Context, projectName string, options
4444

4545
w := progress.ContextWriter(ctx)
4646

47-
name := getCanonicalContainerName(container)
47+
name := getCanonicalContainerName(ctr)
4848
msg := fmt.Sprintf("Commit %s", name)
4949

5050
w.Event(progress.Event{
@@ -65,7 +65,7 @@ func (s *composeService) commit(ctx context.Context, projectName string, options
6565
return nil
6666
}
6767

68-
response, err := clnt.ContainerCommit(ctx, container.ID, containerType.CommitOptions{
68+
response, err := clnt.ContainerCommit(ctx, ctr.ID, container.CommitOptions{
6969
Reference: options.Reference,
7070
Comment: options.Comment,
7171
Author: options.Author,

0 commit comments

Comments
 (0)