-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Add go modules to version response #50934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add moby and containerd modules to version output along with the module path. Add the main module path to the engine version output. Signed-off-by: Derek McGowan <derek@mcg.dev>
case "github.com/moby/moby/api": | ||
name = "moby/api" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the version of the api
module will be confusing; I don't think it adds anything, because the version of the module does not determine the API version that's supported by the daemon. I can update the API module to (e.g.) get bug-fixes in, but it won't make the daemon support new features of the API. The version of the API supported by the daemon is (currently) controlled by the MinAPIVersion
and MaxAPIVersion
consts.
Lines 58 to 66 in f835ff6
// MaxAPIVersion is the highest REST API version supported by the daemon. | |
// | |
// This version may be lower than the version of the api library module used. | |
MaxAPIVersion = "1.52" | |
// MinAPIVersion is the minimum API version supported by the API. | |
// This version can be overridden through the "DOCKER_MIN_API_VERSION" | |
// environment variable. It currently defaults to the minimum API version | |
// implemented in the API module. | |
MinAPIVersion = "1.24" |
case "github.com/moby/moby/client": | ||
name = "moby/client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client is not used by the daemon itself, only for integration tests, so I don't think we should add it.
case "github.com/containerd/containerd/v2": | ||
name = "containerd/client" | ||
case "github.com/containerd/containerd/api": | ||
name = "containerd/api" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly wondering if we already need to add these; or at least I'm not sure if these are directly user-facing until we would expose / proxy the containerd API; currently it's an internal implementation detail, because what's p
8000
ossible to be consumed is whatever we implemented using these modules. Ultimately to know the module versions used, all you need is the version of the moby/moby/v2
which, being the top-most module, effectively is the manifest of all other module versions, and this information can still be obtained from the binary;
go version -m /usr/local/bin/dockerd
/usr/local/bin/dockerd: go1.24.7
path github.com/moby/moby/v2/cmd/dockerd
mod github.com/moby/moby/v2 (devel)
dep cloud.google.com/go/compute/metadata v0.6.0
dep cloud.google.com/go/logging v1.9.0
full output
go version -m /usr/local/bin/dockerd
/usr/local/bin/dockerd: go1.24.7
path github.com/moby/moby/v2/cmd/dockerd
mod github.com/moby/moby/v2 (devel)
dep cloud.google.com/go/compute/metadata v0.6.0
dep cloud.google.com/go/logging v1.9.0
dep cloud.google.com/go/longrunning v0.5.5
dep code.cloudfoundry.org/clock v1.37.0
dep dario.cat/mergo v1.0.2
dep github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
dep github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0
dep github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0
dep github.com/Graylog2/go-gelf v0.0.0-20191017102106-1550ee647df0
dep github.com/Microsoft/hcsshim v0.13.0
dep github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91
dep github.com/agext/levenshtein v1.2.3
dep github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092
dep github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
dep github.com/armon/go-metrics v0.4.1
dep github.com/aws/aws-sdk-go-v2 v1.30.3
dep github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3
dep github.com/aws/aws-sdk-go-v2/config v1.27.27
dep github.com/aws/aws-sdk-go-v2/credentials v1.17.27
dep github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11
dep github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15
dep github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15
dep github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0
dep github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.32.0
dep github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3
dep github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17
dep github.com/aws/aws-sdk-go-v2/service/sso v1.22.4
dep github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4
dep github.com/aws/aws-sdk-go-v2/service/sts v1.30.3
dep github.com/aws/smithy-go v1.20.3
dep github.com/beorn7/perks v1.0.1
dep github.com/bits-and-blooms/bitset v1.13.0
dep github.com/cenkalti/backoff/v4 v4.3.0
dep github.com/cespare/xxhash/v2 v2.3.0
dep github.com/cilium/ebpf v0.17.3
dep github.com/cloudflare/cfssl v1.6.4
dep github.com/container-storage-interface/spec v1.5.0
dep github.com/containerd/accelerated-container-image v1.3.0
dep github.com/containerd/cgroups/v3 v3.0.5
dep github.com/containerd/console v1.0.5
dep github.com/containerd/containerd/api v1.9.0
dep github.com/containerd/containerd/v2 v2.1.4
dep github.com/containerd/continuity v0.4.5
dep github.com/containerd/errdefs v1.0.0
dep github.com/containerd/errdefs/pkg v0.3.0
dep github.com/containerd/fifo v1.1.0
dep github.com/containerd/go-cni v1.1.12
dep github.com/containerd/go-runc v1.1.0
dep github.com/containerd/log v0.1.0
dep github.com/containerd/platforms v1.0.0-rc.1
dep github.com/containerd/plugin v1.0.0
dep github.com/containerd/stargz-snapshotter/estargz v0.16.3
dep github.com/containerd/ttrpc v1.2.7
dep github.com/containerd/typeurl/v2 v2.2.3
dep github.com/containernetworking/cni v1.3.0
dep github.com/containernetworking/plugins v1.7.1
dep github.com/coreos/go-systemd/v22 v22.5.0
dep github.com/cyphar/filepath-securejoin v0.4.1
dep github.com/davecgh/go-spew v1.1.1
dep github.com/deckarep/golang-set/v2 v2.3.0
dep github.com/dimchansky/utfbom v1.1.1
dep github.com/distribution/reference v0.6.0
dep github.com/docker/distribution v2.8.3+incompatible
dep github.com/docker/go-connections v0.6.0
dep github.com/docker/go-events v0.0.0-20250808211157-605354379745
dep github.com/docker/go-metrics v0.0.1
dep github.com/docker/go-units v0.5.0
dep github.com/dustin/go-humanize v1.0.0
dep github.com/felixge/httpsnoop v1.0.4
dep github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611
dep github.com/fluent/fluent-logger-golang v1.10.1
dep github.com/fsnotify/fsnotify v1.9.0
dep github.com/go-logr/logr v1.4.2
dep github.com/go-logr/stdr v1.2.2
dep github.com/godbus/dbus/v5 v5.1.0
dep github.com/gofrs/flock v0.12.1
dep github.com/gogo/protobuf v1.3.2
dep github.com/golang-jwt/jwt/v5 v5.2.2
dep github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f
dep github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8
dep github.com/golang/protobuf v1.5.4
dep github.com/google/btree v1.1.3
dep github.com/google/certificate-transparency-go v1.1.4
dep github.com/google/go-cmp v0.7.0
dep github.com/google/s2a-go v0.1.7
dep github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
dep github.com/google/uuid v1.6.0
dep github.com/googleapis/enterprise-certificate-proxy v0.3.2
dep github.com/googleapis/gax-go/v2 v2.12.0
dep github.com/gorilla/mux v1.8.1
dep github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
dep github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1
dep github.com/hashicorp/errwrap v1.1.0
dep github.com/hashicorp/go-immutable-radix v1.3.1
dep github.com/hashicorp/go-immutable-radix/v2 v2.1.0
dep github.com/hashicorp/go-memdb v1.3.2
dep github.com/hashicorp/go-msgpack v0.5.5
dep github.com/hashicorp/go-multierror v1.1.1
dep github.com/hashicorp/go-sockaddr v1.0.2
dep github.com/hashicorp/golang-lru v0.5.4
dep github.com/hashicorp/golang-lru/v2 v2.0.7
dep github.com/hashicorp/memberlist v0.4.0
dep github.com/hashicorp/serf v0.8.5
dep github.com/in-toto/in-toto-golang v0.9.0
dep github.com/ishidawataru/sctp v0.0.0-20250829011129-4b890084db30
dep github.com/jmoiron/sqlx v1.3.3
dep github.com/klauspost/compress v1.18.0
dep github.com/miekg/dns v1.1.66
dep github.com/mistifyio/go-zfs/v3 v3.0.1
dep github.com/mitchellh/copystructure v1.2.0
dep github.com/mitchellh/hashstructure/v2 v2.0.2
dep github.com/mitchellh/reflectwalk v1.0.2
dep github.com/moby/buildkit v0.24.0
dep github.com/moby/docker-image-spec v1.3.1
dep github.com/moby/go-archive v0.1.0
dep github.com/moby/ipvs v1.1.0
dep github.com/moby/locker v1.0.1
dep github.com/moby/moby/api v1.52.0-beta.1
dep github.com/moby/patternmatcher v0.6.0
dep github.com/moby/profiles/apparmor v0.1.0
dep github.com/moby/profiles/seccomp v0.1.0
dep github.com/moby/pubsub v1.0.0
dep github.com/moby/swarmkit/v2 v2.0.0
dep github.com/moby/sys/atomicwriter v0.1.0
dep github.com/moby/sys/mount v0.3.4
dep github.com/moby/sys/mountinfo v0.7.2
dep github.com/moby/sys/reexec v0.1.0
dep github.com/moby/sys/sequential v0.6.0
dep github.com/moby/sys/signal v0.7.1
dep github.com/moby/sys/symlink v0.3.0
dep github.com/moby/sys/user v0.4.0
dep github.com/moby/sys/userns v0.1.0
dep github.com/moby/term v0.5.2
dep github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
dep github.com/opencontainers/cgroups v0.0.4
dep github.com/opencontainers/go-digest v1.0.0
dep github.com/opencontainers/image-spec v1.1.1
dep github.com/opencontainers/runtime-spec v1.2.1
dep github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626
dep github.com/opencontainers/selinux v1.12.0
dep github.com/package-url/packageurl-go v0.1.1
dep github.com/pelletier/go-toml v1.9.5
dep github.com/pelletier/go-toml/v2 v2.2.4
dep github.com/philhofer/fwd v1.2.0
dep github.com/pkg/errors v0.9.1
dep github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
dep github.com/pmezard/go-difflib v1.0.0
dep github.com/prometheus/client_golang v1.22.0
dep github.com/prometheus/client_model v0.6.1
dep github.com/prometheus/common v0.62.0
dep github.com/prometheus/procfs v0.15.1
dep github.com/rootless-containers/rootlesskit/v2 v2.3.5
dep github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529
dep github.com/secure-systems-lab/go-securesystemslib v0.6.0
dep github.com/shibumi/go-pathspec v1.3.0
dep github.com/sirupsen/logrus v1.9.3
dep github.com/spdx/tools-golang v0.5.5
dep github.com/spf13/cobra v1.10.1
dep github.com/spf13/pflag v1.0.10
dep github.com/stretchr/testify v1.10.0
dep github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635
dep github.com/tinylib/msgp v1.3.0
dep github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323
dep github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f
dep github.com/tonistiigi/go-actions-cache v0.0.0-20250626083717-378c5ed1ddd9
dep github.com/tonistiigi/go-archvariant v1.0.0
dep github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0
dep github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
dep github.com/vbatts/tar-split v0.12.1
dep github.com/vishvananda/netlink v1.3.1
dep github.com/vishvananda/netns v0.0.5
dep github.com/weppos/publicsuffix-go v0.15.1-0.20210511084619-b1f36a2d6c0b
dep github.com/zmap/zcrypto v0.0.0-20210511125630-18f1e0152cfc
dep github.com/zmap/zlint/v3 v3.1.0
dep go.etcd.io/bbolt v1.4.3
dep go.etcd.io/etcd/client/pkg/v3 v3.5.16
dep go.etcd.io/etcd/pkg/v3 v3.5.16
dep go.etcd.io/etcd/raft/v3 v3.5.16
dep go.etcd.io/etcd/server/v3 v3.5.16
dep go.opencensus.io v0.24.0
dep go.opentelemetry.io/auto/sdk v1.1.0
dep go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0
dep go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0
dep go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0
dep go.opentelemetry.io/contrib/processors/baggagecopy v0.4.0
dep go.opentelemetry.io/otel v1.35.0
dep go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0
dep go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0
dep go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0
dep go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
dep go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0
dep go.opentelemetry.io/otel/metric v1.35.0
dep go.opentelemetry.io/otel/sdk v1.35.0
dep go.opentelemetry.io/otel/sdk/metric v1.35.0
dep go.opentelemetry.io/otel/trace v1.35.0
dep go.opentelemetry.io/proto/otlp v1.5.0
dep go.uber.org/multierr v1.11.0
dep go.uber.org/zap v1.27.0
dep golang.org/x/crypto v0.37.0
dep golang.org/x/mod v0.24.0
dep golang.org/x/net v0.39.0
dep golang.org/x/oauth2 v0.29.0
dep golang.org/x/sync v0.16.0
dep golang.org/x/sys v0.33.0
dep golang.org/x/text v0.24.0
dep golang.org/x/time v0.11.0
dep google.golang.org/api v0.160.0
dep google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de
dep google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a
dep google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a
dep google.golang.org/grpc v1.72.2
dep google.golang.org/protobuf v1.36.6
dep gopkg.in/yaml.v3 v3.0.1
dep k8s.io/klog/v2 v2.130.1
dep resenje.org/singleflight v0.4.3
dep sigs.k8s.io/yaml v1.4.0
dep tags.cncf.io/container-device-interface v1.0.1
dep tags.cncf.io/container-device-interface/specs-go v1.0.0
build -buildmode=exe
build -compiler=gc
build -ldflags="-w -X \"github.com/moby/moby/v2/dockerversion.Version=dev\" -X \"github.com/moby/moby/v2/dockerversion.GitCommit=9760b1f3003c69879d6bf330f44740297ce59335\" -X \"github.com/moby/moby/v2/dockerversion.BuildTime=2025-09-09T08:04:12.000000000+00:00\" -X \"github.com/moby/moby/v2/dockerversion.PlatformName=\" -X \"github.com/moby/moby/v2/dockerversion.ProductName=\" -X \"github.com/moby/moby/v2/dockerversion.DefaultProductLicense=\" -extldflags -static "
build -tags=netgo,osusergo,static_build,journald
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=arm64
build GOOS=linux
build GOARM64=v8.0
build vcs=git
build vcs.revision=9760b1f3003c69879d6bf330f44740297ce59335
build vcs.time=2025-09-05T23:49:30Z
build vcs.modified=true
v.Components = append(v.Components, types.ComponentVersion{ | ||
Name: name, | ||
Version: dep.Version, | ||
Details: map[string]string{ | ||
"Module": dep.Path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! These should probably be details of the Engine
component as they describe properties of the engine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can discuss how built in components might be separated from the separate binary components. I tried putting them all as engine details, but then the cli
side would still look a little funky dumping so much info under engine.
} | ||
|
||
func (daemon *Daemon) fillModuleversion(ctx context.Context, v *types.Version) error { | ||
info, ok := debug.ReadBuildInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are also reading build info in
buildInfo, _ = debug.ReadBuildInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was also considering if some of these should be injected into the daemon when constructing it; i.e., if the cmd/dockerd
package should construct version information, and passing it to the daemon.New()
constructor. (I think we were discussing some of that related to #46464, and #50587, but I'm trying to find back that discussion 😓)
Add moby and containerd modules to version output along with the module path.
Add the main module path to the engine version output.
Example docker version output (with one change to support showing up under Engine)