Commit Graph

622 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
0678de9c87 cmd/dockerd: main(): remove "onError" func
Remove the redundant abstraction; just inline it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 15:52:35 +01:00
David Scott
d6ceff48bf delete redundant/incorrect cmd/dockerd/README.md
The README was useful when it was pointing to docker.go and when
docker.go contained the arg parsing and env setting code, but the
structure was simplified by @dmcgowan in 33139da522

It seems pointless to update it to say:

> main.go contains Docker daemon's main function.

and this part is out of date

> This file provides first line CLI argument parsing and environment variable setting.

It seems redundant with the new simpler structure, so delete it.

Signed-off-by: David Scott <dave@recoil.org>
2025-11-06 13:09:08 +00:00
Sebastiaan van Stijn
69702bd821 fix minor linting issues
Making my IDE less noisy

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-15 22:30:38 +02:00
Sebastiaan van Stijn
1135ab0283 Dockerfile: update xx to v1.7.0
full diff: https://github.com/tonistiigi/xx/compare/v1.6.1...v1.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-22 13:06:51 +02:00
Albin Kerouanton
9dc0c094e6 cmd/docker-proxy: set O_NONBLOCK unconditionally
Prior to commit b5bf89c31, all socket fds passed to the docker-proxy
were getting the O_NONBLOCK flag set. However, that commit added support
for SCTP socket-passing, and had to conditionally guard this behavior to
not use it on SCTP sockets due to ishidawataru/sctp not clearing the
flag.

A fix was made in ishidawataru/sctp (see [1]), so we can remove that
condition.

[1]: https://github.com/ishidawataru/sctp/commit/4b890084db30

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-08-29 07:50:48 +02:00
Sebastiaan van Stijn
c98e5cb60b update github links to moby/moby
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 01:48:55 +02:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Albin Kerouanton
b5bf89c315 libnet/d/bridge: pass SCTP sock to the proxy
Since commit b3fabedec, the bridge driver maps ports following a 3-step
process: 1. create a socket, and bind it to the host port; 2. create
iptables rules; 3. start the userland proxy (if it's enabled). This
ensures that the port is really free before inserting iptables rules
that could otherwise disrupt host services.

However, this 3-step process wasn't implemented for SCTP, because we had
no way to instiantiate an SCTP listener from an fd. Since
github.com/ishidawataru/sctp@4719921f9, we can.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-07-08 20:07:22 +02:00
Kevin Alvarez
44623fb856 cmd: use dockerfile to generate win event messages
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-26 17:03:32 +02:00
Kevin Alvarez
0ea20c9f72 cmd: fix winresources and move them out cli package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-26 15:56:23 +02:00
Derek McGowan
33139da522 Split part of dockerd main to command under daemon
Allows using daemon/internal packages when creating dockerd

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-23 14:45:03 -07:00
Derek McGowan
98047c5190 Move cmd/dockerd/trap to daemon/command/trap
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-23 14:45:03 -07:00
Derek McGowan
ea11b5f3fe Move cmd/dockerd/debug to daemon/command/debug
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-23 14:45:02 -07:00
Matthieu MOREL
6d737371b8 fix comparison rule from errorlint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-13 08:26:56 +00:00
Paweł Gronowski
b5d26e5883 Merge pull request #50078 from vvoland/cdi-default-cache
daemon: Configure default CDI cache
2025-06-12 11:36:32 +00:00
Matthieu MOREL
a62de57aa1 fix sprintfQuotedString from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Sebastiaan van Stijn
d469079338 cmd: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:11 +02:00
Jonathan A. Sternberg
7994426e61 Revert "containerd: images overridden by a build are kept dangling"
This reverts commit 50a856157c.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-05-29 13:23:45 -05:00
Paweł Gronowski
027588eba0 builder: Pass cdi cache instead of CDISpecDirs
Instead of passing the dirs for buildkit to configure the same cache
instance, just pass the shared CDI cache instance.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-28 13:31:45 +02:00
Sebastiaan van Stijn
c6b9bb00f9 api/server/router/build: BuilderVersion: allow buildkit on Windows
Commit 7b153b9e28 changed the daemon to
advertise the recommended builder to use to V2 (BuildKit) for Linux
daemons, and V1 (Legacy Builder) for Windows daemons. For Linux daemons
we allowed the default to be overridden through the "features" field
in the daemon config (daemon.json), but for Windows we hard-coded it
to be V1, and no option to override.

With work in progress on implementing support for Windows in BuildKit,
we should remove this hardcoded assumption, and allow the default to
be overridden to advertise that BuildKit is supported.

Note that BuildKit on Windows is still very much a "work in progress",
and enabling it in the daemon may not even work, so users should not
try to enable this feature; a warning-level log is added to make it
visible that the feature is enabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-22 12:36:47 +02:00
Paweł Gronowski
4cecce03f6 daemon: Enable CDI by default
CDI will now be enabled by default unless opted-out by setting `cdi`
feature to `false`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-05-15 22:13:19 +02:00
Rafael Fernández López
8e57a019dc fix: load the CDI driver before the dockerd daemon starts
Signed-off-by: Rafael Fernández López <ereslibre@ereslibre.es>
2025-05-15 12:00:28 +02:00
Paweł Gronowski
2e25c2b14f Merge pull request #49702 from jsternberg/containerd-dangling-build-image
containerd: images overridden by a build are kept dangling
2025-05-14 17:35:32 +00:00
Sebastiaan van Stijn
4b6a9d23af cmd/dockerd/trap: use t.TempDir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-12 12:14:35 +02:00
Derek McGowan
aef409dfb2 Remove unused reference store in image api
The image api already defines the backend used and does
not directly use the reference store backend. It also should not
directly use the reference store backend.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-05-03 21:59:55 -07:00
Rob Murray
44a3453d73 Add daemon option --allow-direct-routing
Per-network option com.docker.network.bridge.trusted-host-interfaces
accepts a list of interfaces that are allowed to route
directly to a container's published ports in a bridge
network with nat enabled.

This daemon level option disables direct access filtering,
enabling direct access to published ports on container
addresses in all bridge networks, via all host interfaces.

It overlaps with short-term env-var workaround:
  DOCKER_INSECURE_NO_IPTABLES_RAW=1
- it does not allow packets sent from outside the host to reach
  ports published only to 127.0.0.1
- it will outlive iptables (the workaround was initially intended
  for hosts that do not have kernel support for the "raw" iptables
  table).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-04-30 20:59:28 +01:00
Jonathan A. Sternberg
50a856157c containerd: images overridden by a build are kept dangling
The build exporter now clears the image tags and always exported to a
dangling image. It then uses the image tagger to perform the tagging
which causes the dangling image to be removed and the naming message to
be sent correctly.

An additional progress message is sent to indicate the renaming.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-04-25 09:29:45 -05:00
Sebastiaan van Stijn
eede75c9d4 testing: remove some defer cleanup in favor of test.Cleanup()
gotest.tools v3.0.1 and up support Go's native test.Cleanup(), which
means that manually calling the cleanup functions in a defer is no
longer needed.

Some of these could probably be replaced by Go's native `t.TempDir()`,
but keeping that for a follow-up exercise.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-19 16:35:24 +02:00
Sebastiaan van Stijn
7435e4a1be registry: remove deprecated ServiceConfig.AllowNondistributableArtifacts
This option was deprecated in 1932091e21, and
is no longer used. It was only kept to allow priniting a deprecation warning
if the config would happen to have the field set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-09 15:26:50 +02:00
Albin Kerouanton
4276f330fc cmd/docker-proxy: do not eagerly GC one-sided UDP conns
The UDP proxy is setting a deadline of 90 seconds when reading from the
backend. If no data is received within this interval, it reclaims the
connection.

This means, the backend would see a different connection every 90
seconds if the backend never sends back any reply to a client.

This change prevents the proxy from eagerly GC'ing such connections by
taking into account the last time a datagram was proxyed to the backend.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-03-17 17:51:50 +01:00
Albin Kerouanton
0356854327 cmd/docker-proxy: make the conntrack timeout a property of UDPProxy
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-03-17 17:50:38 +01:00
Albin Kerouanton
d70fd32a18 cmd/docker-proxy: UDP: thread-safe Write and Close
The UDP proxy used by cmd/docker-proxy is executing Write and Close in
two separate goroutines, such that a Close could interrupt an in-flight
Write.

Introduce a `connTrackEntry` that wraps a `net.Conn` and a `sync.Mutex`
to ensure that Write and Close are serialized.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-03-17 17:50:38 +01:00
Sebastiaan van Stijn
b633c4cc33 registry: deprecate SetCertsDir
This function had to be called both in the daemon startup, as well as
the CLI startup. Which, in case of the cli, meant that the registry
package became a required dependency for all CLI-plugins.

Make the package itself aware of situations where it's running with
rootlessKit enabled. Altogether we should get rid of this package-level
variable, and instead store this in our configuration, and pass through
where it's used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 19:11:09 +01:00
Sebastiaan van Stijn
556633ca47 cmd/dockerd: daemonCLI.start: scope local errors
Scope errors locally and don't use special names if there's no reason
for it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 00:27:12 +01:00
Sebastiaan van Stijn
8b59e1a398 cmd/dockerd: daemonCLI.start: return error instead of log.Fatal
We return errors in this function, except for this one, which was logged
as Fatal. If we want errors to be logged, we should probably do so in
the function calling daemonCLI.start.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 00:15:16 +01:00
Sebastiaan van Stijn
8a8cdaaa11 cmd/dockerd: daemonCLI.start: don't log warnings before failing
This function could produce various logs ("Running in rootless mode") at
the start, but further steps could still fail (such as running with
RootlessKit, but not being configured as rootless).

This patch moves the informational / warning logs further down, so that
we don't produce logs before failing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 00:08:45 +01:00
Sebastiaan van Stijn
6e30a4cc0c cmd/dockerd: explicitly access Config fields
Explicitly access config field through the Config field, instead
of the top-level "cli". This allows spotting locations where we don't
depend on the CLI, but really just the Config.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-06 23:50:26 +01:00
Sebastiaan van Stijn
dfecaaf908 cmd/dockerd: rewrite getContainerdDaemonOpts to a func
This method only depended on the CLI config; rewrite it to a
regular function, returning the opts to use for the containerd
daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-06 23:50:26 +01:00
Sebastiaan van Stijn
b95fdcd084 cmd/dockerd: createAndStartCluster: change to accept Config
This function took the whole daemon CLI as argument, but only needed
the config; change the signature to accept that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-06 23:50:26 +01:00
Sebastiaan van Stijn
29aa7e15bd cmd/dockerd: rewrite getSwarmRunRoot to a regular func
This method only required the config to be passed; rewrite it to a
regular func that accepts the config.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-06 23:50:26 +01:00
Sebastiaan van Stijn
29c296e1dd cmd/dockerd: rename vars that shadowed imports
Also use a consistent name for "config" arguments.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-06 23:50:26 +01:00
Sebastiaan van Stijn
4d3d4bbeeb daemon/cluster: remove Config.WatchStream and move to constructor
The WatchStream field was set as configuration option in cmd/dockerd,
but not configurable. Move creating the stream to the constructor,
and remove the configuration option. This field was introduced in
59d45c384a, at which time the cmd/dockerd
code needed direct access to the stream, but a later refactor in
05346355db introduced an accessor
(GetWatchStream) for this.

The cluster.Config struct is only used internally, it's unlikely
for any external project to use this, so skipping deprecation.

With this change, the cmd/dockerd package no longer has a direct
import of swarmkit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-26 15:24:55 +01:00
Rob Murray
013c43fb56 Mark default-bridge-only opts in --help and manpage
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-02-22 20:21:23 +00:00
Sebastiaan van Stijn
d1c6550f71 daemon: use structured logs for printing reloaded config, move to cli
- Move logging out of config.Reload and daemon.Reload itself, as it was not
  the right place to know whether it was a "signal" that triggered the reload.
- Use Daemon.Config() to get the new config after reloading. This returns an
  immutable copy of the daemon's config, so we can redact fields without having
  to use an ad-hoc struct to shadow the underlying fields.
- Use structured logs for logging config reload events.

Before this (plain text):

    INFO[2025-02-08T12:13:53.389649297Z] Got signal to reload configuration, reloading from: /etc/docker/daemon.json
    INFO[2025-02-08T12:30:34.857691260Z] Reloaded configuration: {"pidfile":"/var/run/docker.pid","data-root":"/var/lib/docker","exec-root":"/var/run/docker","group":"docker","max-concurrent-downloads":3,"max-concurrent-uploads":5,"max-download-attempts":5,"shutdown-timeout":15,"hosts":["unix:///var/run/docker.sock"],"log-level":"info","log-format":"text","swarm-default-advertise-addr":"","swarm-raft-heartbeat-tick":0,"swarm-raft-election-tick":0,"metrics-addr":"","host-gateway-ips":[""],"log-driver":"json-file","mtu":1500,"ip":"0.0.0.0","icc":true,"iptables":true,"ip6tables":true,"ip-forward":true,"ip-masq":true,"userland-proxy":true,"userland-proxy-path":"/usr/local/bin/docker-proxy","default-address-pools":{"Values":null},"network-control-plane-mtu":1500,"experimental":false,"containerd":"/var/run/docker/containerd/containerd.sock","features":{"containerd-snapshotter":false},"builder":{"GC":{},"Entitlements":{}},"containerd-namespace":"moby","containerd-plugin-namespace":"plugins.moby","default-runtime":"runc","runtimes":{"crun":{"path":"/usr/local/bin/crun"}},"seccomp-profile":"builtin","default-shm-size":67108864,"default-ipc-mode":"private","default-cgroupns-mode":"private","resolv-conf":"/etc/resolv.conf","proxies":{}}

Before this (JSON logs):

    {"level":"info","msg":"Reloaded configuration: {\"pidfile\":\"/var/run/docker.pid\",\"data-root\":\"/var/lib/docker\",\"exec-root\":\"/var/run/docker\",\"group\":\"docker\",\"max-concurrent-downloads\":3,\"max-concurrent-uploads\":5,\"max-download-attempts\":5,\"shutdown-timeout\":15,\"hosts\":[\"unix:///var/run/docker.sock\"],\"log-level\":\"info\",\"log-format\":\"json\",\"swarm-default-advertise-addr\":\"\",\"swarm-raft-heartbeat-tick\":0,\"swarm-raft-election-tick\":0,\"metrics-addr\":\"\",\"host-gateway-ips\":[\"\"],\"log-driver\":\"json-file\",\"mtu\":1500,\"ip\":\"0.0.0.0\",\"icc\":true,\"iptables\":true,\"ip6tables\":true,\"ip-forward\":true,\"ip-masq\":true,\"userland-proxy\":true,\"userland-proxy-path\":\"/usr/local/bin/docker-proxy\",\"default-address-pools\":{\"Values\":null},\"network-control-plane-mtu\":1500,\"experimental\":false,\"containerd\":\"/var/run/docker/containerd/containerd.sock\",\"features\":{\"containerd-snapshotter\":false},\"builder\":{\"GC\":{},\"Entitlements\":{}},\"containerd-namespace\":\"moby\",\"containerd-plugin-namespace\":\"plugins.moby\",\"default-runtime\":\"runc\",\"runtimes\":{\"crun\":{\"path\":\"/usr/local/bin/crun\"}},\"seccomp-profile\":\"builtin\",\"default-shm-size\":67108864,\"default-ipc-mode\":\"private\",\"default-cgroupns-mode\":\"private\",\"resolv-conf\":\"/etc/resolv.conf\",\"proxies\":{}}","time":"2025-02-08T12:24:38.600761054Z"}

After this (plain text):

    INFO[2025-02-08T12:30:34.835953594Z] Got signal to reload configuration            config-file=/etc/docker/daemon.json
    INFO[2025-02-08T12:30:34.857614135Z] Reloaded configuration                        config="{\"pidfile\":\"/var/run/docker.pid\",\"data-root\":\"/var/lib/docker\",\"exec-root\":\"/var/run/docker\",\"group\":\"docker\",\"max-concurrent-downloads\":3,\"max-concurrent-uploads\":5,\"max-download-attempts\":5,\"shutdown-timeout\":15,\"hosts\":[\"unix:///var/run/docker.sock\"],\"log-level\":\"info\",\"log-format\":\"text\",\"swarm-default-advertise-addr\":\"\",\"swarm-raft-heartbeat-tick\":0,\"swarm-raft-election-tick\":0,\"metrics-addr\":\"\",\"host-gateway-ips\":[\"\"],\"log-driver\":\"json-file\",\"mtu\":1500,\"ip\":\"0.0.0.0\",\"icc\":true,\"iptables\":true,\"ip6tables\":true,\"ip-forward\":true,\"ip-masq\":true,\"userland-proxy\":true,\"userland-proxy-path\":\"/usr/local/bin/docker-proxy\",\"default-address-pools\":{\"Values\":null},\"network-control-plane-mtu\":1500,\"experimental\":false,\"containerd\":\"/var/run/docker/containerd/containerd.sock\",\"features\":{\"containerd-snapshotter\":false},\"builder\":{\"GC\":{},\"Entitlements\":{}},\"containerd-namespace\":\"moby\",\"containerd-plugin-namespace\":\"plugins.moby\",\"default-runtime\":\"runc\",\"runtimes\":{\"crun\":{\"path\":\"/usr/local/bin/crun\"}},\"seccomp-profile\":\"builtin\",\"default-shm-size\":67108864,\"default-ipc-mode\":\"private\",\"default-cgroupns-mode\":\"private\",\"resolv-conf\":\"/etc/resolv.conf\",\"proxies\":{}}"

After this (JSON logs):

    {"config-file":"/etc/docker/daemon.json","level":"info","msg":"Got signal to reload configuration","time":"2025-02-08T12:24:38.589955637Z"}
    {"config":"{\"pidfile\":\"/var/run/docker.pid\",\"data-root\":\"/var/lib/docker\",\"exec-root\":\"/var/run/docker\",\"group\":\"docker\",\"max-concurrent-downloads\":3,\"max-concurrent-uploads\":5,\"max-download-attempts\":5,\"shutdown-timeout\":15,\"hosts\":[\"unix:///var/run/docker.sock\"],\"log-level\":\"info\",\"log-format\":\"json\",\"swarm-default-advertise-addr\":\"\",\"swarm-raft-heartbeat-tick\":0,\"swarm-raft-election-tick\":0,\"metrics-addr\":\"\",\"host-gateway-ips\":[\"\"],\"log-driver\":\"json-file\",\"mtu\":1500,\"ip\":\"0.0.0.0\",\"icc\":true,\"iptables\":true,\"ip6tables\":true,\"ip-forward\":true,\"ip-masq\":true,\"userland-proxy\":true,\"userland-proxy-path\":\"/usr/local/bin/docker-proxy\",\"default-address-pools\":{\"Values\":null},\"network-control-plane-mtu\":1500,\"experimental\":false,\"containerd\":\"/var/run/docker/containerd/containerd.sock\",\"features\":{\"containerd-snapshotter\":false},\"builder\":{\"GC\":{},\"Entitlements\":{}},\"containerd-namespace\":\"moby\",\"containerd-plugin-namespace\":\"plugins.moby\",\"default-runtime\":\"runc\",\"runtimes\":{\"crun\":{\"path\":\"/usr/local/bin/crun\"}},\"seccomp-profile\":\"builtin\",\"default-shm-size\":67108864,\"default-ipc-mode\":\"private\",\"default-cgroupns-mode\":\"private\",\"resolv-conf\":\"/etc/resolv.conf\",\"proxies\":{}}","level":"info","msg":"Reloaded configuration","time":"2025-02-08T12:24:38.600736179Z"}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-14 12:22:10 +01:00
Tonis Tiigi
e364e28ec8 vendor: update buildkit to v0.20.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-12 11:00:04 -08:00
Sebastiaan van Stijn
2e9e7989f8 cmd/dockerd: initBuildkit: return close-func
Make it more explicit that callers must call close

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-06 13:56:04 +01:00
Brian Goff
2dc03f934f cmd/dockerd: refactor buildkit init in daemon startup
- Move the "Daemon has completed initialization" log to where it has
  actually completed initialization.
- Move buildkit init to its own function.
- Move the builder options to a separate struct, and change initBuildkit
  to return it instead of passing the router-options and manipulate it.

Co-authored-by: Brian Goff <cpuguy83@gmail.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-06 13:53:29 +01:00
Sebastiaan van Stijn
3bb40af036 dockerd: enable shell-completion; add (hidden) completion subcommand
This required a minor hack to accommodate Cobra's logic (and a TODO was
added to see if we can improve that logic in upstream). Some changes also
had to be made to our "Usage" template, as our custom template did not
take into account subcommands and long descriptions for commands. We
should review these templates, as some additional features were added
in upstream Cobra that we currently may not be using.

With this patch:

instructions for the (hidden) completion subcommand:

    docker completion --help

    Usage:  docker completion COMMAND

    Generate the autocompletion script for docker for the specified shell.
    See each sub-command's help for details on how to use the generated script.

    Commands:
      bash        Generate the autocompletion script for bash
      fish        Generate the autocompletion script for fish
      powershell  Generate the autocompletion script for powershell
      zsh         Generate the autocompletion script for zsh

    Run 'docker completion COMMAND --help' for more information on a command.

and instructions for installing:

    dockerd completion bash --help

    Usage:	dockerd completion bash

    Generate the autocompletion script for the bash shell.

    This script depends on the 'bash-completion' package.
    If it is not installed already, you can install it via your OS's package manager.

    To load completions in your current shell session:

        source <(dockerd completion bash)

    To load completions for every new session, execute once:

    #### Linux:

        dockerd completion bash > /etc/bash_completion.d/dockerd

    #### macOS:

        dockerd completion bash > $(brew --prefix)/etc/bash_completion.d/dockerd

    You will need to start a new shell for this setup to take effect.

    Options:
          --help              Print usage
          --no-descriptions   disable completion descriptions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-26 17:12:26 +01:00
Derek McGowan
0aa8fe0bf9 Update to containerd v2.0.2, buildkit v0.19.0-rc2
Update buildkit version to commit which uses 2.0

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-01-15 14:09:30 +01:00
Sebastiaan van Stijn
48e6b4e8f7 vendor: otel v0.56.0 / v1.31.0
Reverts otel workaround, added in cca7085464,
as it's no longer needed:

    === Failed
    === FAIL: cmd/dockerd TestOtelMeterLeak (0.64s)
        daemon_test.go:303: Allocations: 3
        daemon_test.go:307: Allocations count decreased. OTEL leak workaround is no longer needed!

We're keeping the test for now, so that we can check for possible
regressions in the OTel dependencies.

Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-14 15:01:34 +01:00