Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG GO_VERSION=1.21.12
ARG GO_VERSION=1.22.7
ARG XX_VERSION=1.2.1
ARG GOLANGCI_LINT_VERSION=v1.55.2
ARG GOLANGCI_LINT_VERSION=v1.60.2
ARG ADDLICENSE_VERSION=v1.0.0

ARG BUILD_TAGS="e2e"
Expand Down
2 changes: 1 addition & 1 deletion cmd/compatibility/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ARGS:
command = append([]string{arg}, command...)
continue
}
if len(arg) > 0 && arg[0] != '-' {
if arg != "" && arg[0] != '-' {
command = append(command, args[i:]...)
break
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/compose/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func runServices(ctx context.Context, dockerCli command.Cli, opts configOptions)
return err
}
err = project.ForEachService(project.ServiceNames(), func(serviceName string, _ *types.ServiceConfig) error {
fmt.Fprintln(dockerCli.Out(), serviceName)
_, _ = fmt.Fprintln(dockerCli.Out(), serviceName)
return nil
})
return err
Expand All @@ -296,7 +296,7 @@ func runVolumes(ctx context.Context, dockerCli command.Cli, opts configOptions)
return err
}
for n := range project.Volumes {
fmt.Fprintln(dockerCli.Out(), n)
_, _ = fmt.Fprintln(dockerCli.Out(), n)
}
return nil
}
Expand Down Expand Up @@ -335,7 +335,7 @@ func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) err
if err != nil {
return err
}
fmt.Fprintf(dockerCli.Out(), "%s %s\n", name, hash)
_, _ = fmt.Fprintf(dockerCli.Out(), "%s %s\n", name, hash)
}
return nil
}
Expand All @@ -357,7 +357,7 @@ func runProfiles(ctx context.Context, dockerCli command.Cli, opts configOptions,
}
sort.Strings(profiles)
for _, p := range profiles {
fmt.Fprintln(dockerCli.Out(), p)
_, _ = fmt.Fprintln(dockerCli.Out(), p)
}
return nil
}
Expand All @@ -369,7 +369,7 @@ func runConfigImages(ctx context.Context, dockerCli command.Cli, opts configOpti
}

for _, s := range project.Services {
fmt.Fprintln(dockerCli.Out(), api.GetImageNameOrDefault(s, project.Name))
_, _ = fmt.Fprintln(dockerCli.Out(), api.GetImageNameOrDefault(s, project.Name))
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func runEvents(ctx context.Context, dockerCli command.Cli, backend api.Service,
if err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), string(marshal))
_, _ = fmt.Fprintln(dockerCli.Out(), string(marshal))
} else {
fmt.Fprintln(dockerCli.Out(), event)
_, _ = fmt.Fprintln(dockerCli.Out(), event)
}
return nil
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func runImages(ctx context.Context, dockerCli command.Cli, backend api.Service,
}
}
for _, img := range ids {
fmt.Fprintln(dockerCli.Out(), img)
_, _ = fmt.Fprintln(dockerCli.Out(), img)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func runList(ctx context.Context, dockerCli command.Cli, backend api.Service, ls

if lsOpts.Quiet {
for _, s := range stackList {
fmt.Fprintln(dockerCli.Out(), s.Name)
_, _ = fmt.Fprintln(dockerCli.Out(), s.Name)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ func runPort(ctx context.Context, dockerCli command.Cli, backend api.Service, op
return err
}

fmt.Fprintf(dockerCli.Out(), "%s:%d\n", ip, port)
_, _ = fmt.Fprintf(dockerCli.Out(), "%s:%d\n", ip, port)
return nil
}
4 changes: 2 additions & 2 deletions cmd/compose/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func runPs(ctx context.Context, dockerCli command.Cli, backend api.Service, serv

if opts.Quiet {
for _, c := range containers {
fmt.Fprintln(dockerCli.Out(), c.ID)
_, _ = fmt.Fprintln(dockerCli.Out(), c.ID)
}
return nil
}
Expand All @@ -143,7 +143,7 @@ func runPs(ctx context.Context, dockerCli command.Cli, backend api.Service, serv
services = append(services, s)
}
}
fmt.Fprintln(dockerCli.Out(), strings.Join(services, "\n"))
_, _ = fmt.Fprintln(dockerCli.Out(), strings.Join(services, "\n"))
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func runTop(ctx context.Context, dockerCli command.Cli, backend api.Service, opt
})

for _, container := range containers {
fmt.Fprintf(dockerCli.Out(), "%s\n", container.Name)
_, _ = fmt.Fprintf(dockerCli.Out(), "%s\n", container.Name)
err := psPrinter(dockerCli.Out(), func(w io.Writer) {
for _, proc := range container.Processes {
info := []interface{}{}
Expand All @@ -74,7 +74,7 @@ func runTop(ctx context.Context, dockerCli command.Cli, backend api.Service, opt
_, _ = fmt.Fprintf(w, strings.Repeat("%s\t", len(info))+"\n", info...)

}
fmt.Fprintln(w)
_, _ = fmt.Fprintln(w)
},
container.Titles...)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/compose/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ func versionCommand(dockerCli command.Cli) *cobra.Command {

func runVersion(opts versionOptions, dockerCli command.Cli) {
if opts.short {
fmt.Fprintln(dockerCli.Out(), strings.TrimPrefix(internal.Version, "v"))
_, _ = fmt.Fprintln(dockerCli.Out(), strings.TrimPrefix(internal.Version, "v"))
return
}
if opts.format == formatter.JSON {
fmt.Fprintf(dockerCli.Out(), "{\"version\":%q}\n", internal.Version)
_, _ = fmt.Fprintf(dockerCli.Out(), "{\"version\":%q}\n", internal.Version)
return
}
fmt.Fprintln(dockerCli.Out(), "Docker Compose version", internal.Version)
_, _ = fmt.Fprintln(dockerCli.Out(), "Docker Compose version", internal.Version)
}
4 changes: 2 additions & 2 deletions cmd/formatter/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func (l *logConsumer) write(w io.Writer, container, message string) {
timestamp := time.Now().Format(jsonmessage.RFC3339NanoFixed)
for _, line := range strings.Split(message, "\n") {
if l.timestamp {
fmt.Fprintf(w, "%s%s%s\n", p.prefix, timestamp, line)
_, _ = fmt.Fprintf(w, "%s%s%s\n", p.prefix, timestamp, line)
} else {
fmt.Fprintf(w, "%s%s\n", p.prefix, line)
_, _ = fmt.Fprintf(w, "%s%s\n", p.prefix, line)
}
}

Expand Down
31 changes: 14 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@ module github.com/docker/compose/v2

go 1.21.0

toolchain go1.22.2

require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/Microsoft/go-winio v0.6.2
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/buger/goterm v1.0.4
github.com/compose-spec/compose-go/v2 v2.1.6
github.com/containerd/containerd v1.7.20
github.com/containerd/containerd v1.7.22
github.com/containerd/platforms v0.2.1
github.com/davecgh/go-spew v1.1.1
github.com/distribution/reference v0.6.0
github.com/docker/buildx v0.16.2
github.com/docker/cli v27.1.2+incompatible
github.com/docker/buildx v0.17.0
github.com/docker/cli v27.2.1+incompatible
github.com/docker/cli-docs-tool v0.8.0
github.com/docker/docker v27.1.2+incompatible
github.com/docker/docker v27.2.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/docker/go-units v0.5.0
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
Expand All @@ -29,7 +27,7 @@ require (
github.com/mattn/go-shellwords v1.0.12
github.com/mitchellh/go-ps v1.0.0
github.com/mitchellh/mapstructure v1.5.0
github.com/moby/buildkit v0.15.1
github.com/moby/buildkit v0.16.0
github.com/moby/patternmatcher v0.6.0
github.com/moby/term v0.5.0
github.com/morikuni/aec v1.0.0
Expand All @@ -56,7 +54,7 @@ require (
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
golang.org/x/sync v0.7.0
golang.org/x/sys v0.25.0
google.golang.org/grpc v1.60.1
google.golang.org/grpc v1.62.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
)
Expand Down Expand Up @@ -88,7 +86,7 @@ require (
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/ttrpc v1.2.5 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containerd/typeurl/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
Expand Down Expand Up @@ -134,11 +132,11 @@ require (
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/moby/sys/symlink v0.2.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -165,9 +163,8 @@ require (
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
Expand All @@ -177,9 +174,9 @@ require (
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
Loading