79 Commits
Author SHA1 Message Date
Paweł Gronowski a7a3d813d0 daemon/containerd: Support configuration drop-ins for embedded containerd
Load containerd.d/*.toml next to the daemon configuration file when
using embedded containerd.
Only the plugins, disabled_plugins, and required_plugins settings
apply.

Require version 4 or later and reject nested imports, so the merge
order follows the lexical order of the files.

Warn when drop-ins are present but dockerd uses a system or managed
containerd, which ignore them.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-11-06 01:42:04 +01:00
Paweł Gronowski be285dcad8 daemon: Create the extension API socket on first use
Every daemon with an extension host opened an extra full-access API
socket at startup, even when no extension used the API.

The socket is now created when an extension first connects to the API.
The daemonapi client looks up the endpoint on its first connection, so
NewClient no longer takes a context.

The socket is served separately from the configured hosts, returns 503
until the daemon is ready, and closes after extensions shut down.
It is accessible only to the daemon user, or to Administrators and
LocalSystem on Windows.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-11-04 19:48:07 +01:00
Paweł Gronowski fca6d1f16d extpoints: Let extensions use a regular Engine API client
Extensions had no supported way to call the Engine API.
The configured hosts may be socket-activated or TLS-only TCP.

Add the org.mobyproject.extension.daemon.api.v0 point.
It returns the address of a private unix socket where the daemon serves
its regular API handler.

daemonapiv0.NewClient helper resolves the point and returns a
*client.Client.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-11-04 19:47:55 +01:00
Paweł Gronowski fae7dd19ad Merge pull request #53849 from corhere/ocihook
Move the setkey hook listener from libnetwork to the daemon
2026-10-27 21:15:43 +01:00
Sebastiaan van Stijn 1f11085c8e daemon: RestartSwarmContainers: handle context cancellation
Pass the daemon startup context to RestartSwarmContainers and return an
error if startup is canceled.

Stop scheduling additional container starts after cancellation, wait for
already-started work to finish, and propagate the context error so daemon
initialization does not continue after an interrupted restart.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-12 18:39:42 +02:00
Cory Snider efa5230180 builder-next: set the sandbox key through ocihook
BuildKit's bridge network provider creates its sandboxes with
OptionUseExternalKey, so that the sandbox uses the network namespace
runc creates inside the container's user namespace, and installs a
prestart hook which passes that namespace to libnetwork. The hook
re-executed dockerd as "libnetwork-setkey", which located libnetwork's
external key listener from the controller's ID and the exec root, and
the listener looked the sandbox up by container ID.

Make the daemon own an ocihook.Server listening on
<exec-root>/oci-hook.sock, shut it down before the network controller,
and pass it to BuildKit. The provider registers a callback which calls
SetKey on its own sandbox, and unregisters it when the namespace is
closed. It registers the callback with the context BuildKit passed to
the provider when creating the namespace, which is the context of the
container run, so spans started by SetKey are children of the build
step's span, and a cancelled build step cancels SetKey.

Signed-off-by: Cory Snider <csnider@mirantis.com>
Assisted-By: Claude Opus 5.5
2026-10-07 19:06:00 -04:00
Sebastiaan van Stijn 6e7e2aefa5 daemon/command: setupConfigReloadTrap: handle context cancellation
Pass the daemon lifecycle context to the config reload trap and stop the
Unix signal handler when the context is canceled. This also unregisters
the SIGHUP notification when the goroutine exits.

On Windows, signal the Win32 event when the context is canceled to wake
the blocking wait and allow the reload goroutine to exit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-06 12:11:28 +02:00
Paweł Gronowski f28c749752 daemon/command: Replace deprecated tracing log hook
NewLogrusHook from containerd/pkg/tracing will be deprecated in 2.4

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-10 17:59:42 +02:00
Paweł Gronowski f8b81d9066 daemon: Refactor namegenerator into extension
Add a single-provider namesgenerator point with the existing random
generator as its built-in implementation.

Installed extensions can now supply container and Swarm service names,
while failures fall back to the built-in generator so create operations
remain available.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-09-03 11:06:16 +02:00
Paweł Gronowski ad1af3b58c daemon/command: Route extension gRPC requests
Publish extension `service.grpc` services on the API socket while
retaining daemon services and rejecting name collisions. Route
matching gRPC requests through the extension proxy.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-08-26 22:33:40 +02:00
Sebastiaan van Stijn 4c3d81a3fd containerd: split supervisor construction from start
Separate construction of the containerd supervisor from starting and
monitoring the daemon.

This allows callers to configure and inspect the supervisor before starting
it, and keeps runtime operations tied to the context passed to Start.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-23 14:53:16 +02:00
Sebastiaan van Stijn 2b27696c37 containerd: simplify supervisor option construction
`getContainerdDaemonOpts` never returned an error; remove the error-return,
rename it to `supervisorOpts`, and inline it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-23 14:53:15 +02:00
Sebastiaan van Stijn fb21f97c41 containerd: make shutdown waiting explicit
Always return a containerd shutdown wait function after successful
initialization, including when using an externally managed system containerd,
where the function is a no-op.

Use the returned function during the normal shutdown sequence, after the API
server has stopped, so managed and embedded containerd instances have finished
shutting down before tracing is torn down. Keep a deferred context cancellation
as a safeguard for early returns.

Bound OpenTelemetry shutdown to avoid blocking daemon shutdown indefinitely,
and defer returning ServeAPI errors until containerd and tracing shutdown have
completed.

Also report failures while waiting for containerd to stop instead of silently
discarding them.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-23 14:52:56 +02:00
Sebastiaan van Stijn 648335c688 daemon: remove OpenCensus-to-OTEL trace bridge
Hcsshim v0.15.0-rc.4 no longer uses opencensus (since [hcsshim@0f25a01]),
so we can remove the bridge that was added in [moby@4535d63].

This reverts commit 4535d63c91.

[hcsshim@0f25a01]: https://github.com/microsoft/hcsshim/commit/0f25a0125d95e6932d27fde08d1436414819e29a
[moby@4535d63]: https://github.com/moby/moby/commit/4535d63c91bd7d2d2767346965f24ec5e6e5f28d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-19 11:39:17 +02:00
Paweł Gronowski 6d2a4259fb daemon: Allow overriding containerd root from environment
Embedded containerd always derives its persistent root from Docker's
data root, which prevents testing against state from a standalone
containerd daemon.

Use DOCKER_CONTAINERD_ROOT as a temporary override for the exact root
path used by embedded and supervised containerd. Preserve the existing
data-root/containerd/daemon default when the variable is unset.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-24 16:41:18 +02:00
Paweł Gronowski 3b858893a7 builder-next: Use in-memory pipe for embedded containerd
Route BuildKit's worker (and the Windows executor) over the in-memory
pipe instead of the unix socket.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-24 16:39:06 +02:00
Paweł Gronowski a8a1cfd111 daemon: Add embedded containerd mode
Run containerd inside dockerd when the experimental
`embedded-containerd` feature is enabled through `--feature` or the
daemon configuration.

Serve containerd's gRPC API on a Unix socket, or a named pipe on
Windows, for the plugin executor and external tools.
Use an in-memory listener for dockerd's own containerd client. Serve
TTRPC on a platform endpoint so task shims can publish events.

Register only the containerd plugins dockerd needs. Leave CRI, sandbox,
streaming, transfer, NRI, and the restart monitor out of the embedded
server.
Reject `--cri-containerd` when embedded mode is enabled instead of
silently ignoring the requested CRI support.

Check the feature before `ContainerdAddr` so it can override the default
containerd socket supplied by packaged service units. Continue to use
the configured external containerd when the feature is disabled.

Derive the Windows named-pipe address from the daemon state directory so
multiple daemons can run on the same host. Restrict the pipes to the
built-in Administrators group and LocalSystem with the same protected
DACL as dockerd's API pipe, as the default security descriptor depends
on the process token and can expose the containerd endpoints more
broadly than intended. Treat embedded mode as a containerd runtime in
the Windows test environment.

Add the `no_embedded_containerd` build tag so distributors can omit the
embedded plugin graph and its dependencies.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-24 16:39:06 +02:00
Paweł Gronowski 1e6c7a4b2a libcontainerd: Move supervisor under daemon/internal/containerd/server
The supervisor (managed-containerd lifecycle) package manages a
containerd server rather than the libcontainerd client, so group them
under a new daemon/internal/containerd/server parent.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-07-24 16:39:06 +02:00
Paweł Gronowski 4c19a01575 Merge pull request #52048 from shiv-tyagi/vendor-detection
Use CDI  for GPU injection for AMD devices for --gpus
2026-03-05 12:06:54 +00:00
Shiv Tyagi 561a5a9b36 Use CDI for GPU injection for AMD devices for --gpus
Signed-off-by: Shiv Tyagi <Shiv.Tyagi@amd.com>
2026-03-04 13:07:26 +00:00
Cory SniderandSebastiaan van Stijn 40f06bf418 Reapply: daemon/command: add support for sd_notify "reload" notifications
This reapplies the af18206 commit which was reverted by ddb636c.

commit f74b856e1a added an [ExecReload] to
the systemd unit, which allows users to signal the daemon to reload its
config through systemd (`systemctl reload docker.service`).

While reloading works, systemd expects the `ExecReload` command to be
synchronous, so that it knows when the reload completes, and can account
for this when managing dependent services.

> Note however that reloading a daemon by enqueuing a signal (...) is usually
> not a good choice, because this is an asynchronous operation and hence not
> suitable when ordering reloads of multiple services against each other.

Systemd 253 introduced a new Type (Type=notify-reload, see [systemd#25916]),
which allows setting a "ReloadSignal" instead, if the service supports
it by including a [MONOTONIC_USEC] value in its "RELOADING=1"
notifications.

This patch:

- adds reload notifications to the daemon to notify when the daemon got
  signaled to reload its configuration see [sd_notify(3)].
- appends a [MONOTONIC_USEC] value to the reload notification to support
  systemd 253's notify-reload protocol. This is backwards-compatible
  with older systemd releases as the systemd service manager ignores
  unknown assignments in notifications.
- adds a `notifyReady` callback to notify when the reload finished,
  which we currently send regardless if the reload was successful or
  failed (which could be due to an invalid config).

[ExecReload]: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecReload=
[systemd#25916]: https://github.com/systemd/systemd/pull/25916
[MONOTONIC_USEC]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#MONOTONIC_USEC=…
[sd_notify(3)]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#RELOADING=1

Signed-off-by: Cory Snider <csnider@mirantis.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-26 12:08:46 +01:00
Sebastiaan van Stijn 1a1749a082 Merge pull request #52077 from thaJeztah/notify_readier
daemon: send systemd READY=1 after API serve loops start
2026-02-23 14:05:02 +01:00
Sebastiaan van Stijn 99add78b1f daemon: send systemd READY=1 after API serve loops start
The daemon previously signaled systemd (READY=1) before the API Serve loops
were started.

Move the readiness notification until after the API listeners are serving
to reduce the window where systemd considers the daemon ready but the
HTTP accept loop has not yet started.

While modifying, also use `WaitGroup.Go` for a slight cleanup.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-23 12:04:16 +01:00
Sebastiaan van Stijn 5f3c4002bd daemon: fix "Daemon shutdown complete" log arriving too early
Some services are shut-down in a defer, resulting in logs for them being
shut down logged after the "Daemon shutdown complete" log;

    ^CINFO[2026-02-21T16:57:55.312312593Z] Processing signal 'interrupt'
    INFO[2026-02-21T16:57:55.424494218Z] shim disconnected                             id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    INFO[2026-02-21T16:57:55.424642052Z] cleaning up after shim disconnected           id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    INFO[2026-02-21T16:57:55.424655718Z] cleaning up dead shim                         id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    ...
    INFO[2026-02-21T16:57:55.535564427Z] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
    INFO[2026-02-21T16:57:55.536002469Z] Daemon shutdown complete
    INFO[2026-02-21T16:57:55.536108635Z] stopping healthcheck following graceful shutdown  module=libcontainerd
    INFO[2026-02-21T16:57:55.536799719Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby

Move printing the log to a defer so that it's printed last:

    ^CINFO[2026-02-21T17:30:32.762078180Z] Processing signal 'interrupt'
    INFO[2026-02-21T17:30:32.844606222Z] shim disconnected                             id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    INFO[2026-02-21T17:30:32.844780972Z] cleaning up after shim disconnected           id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    INFO[2026-02-21T17:30:32.844787555Z] cleaning up dead shim                         id=1ed1fcfd71c27b5ff4f04c1b33104c17725a841fba7661acea205879fdd687c8 namespace=moby
    ...
    INFO[2026-02-21T17:30:32.962354138Z] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
    INFO[2026-02-21T17:30:32.962715347Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
    INFO[2026-02-21T17:30:32.962760680Z] stopping healthcheck following graceful shutdown  module=libcontainerd
    INFO[2026-02-21T17:30:33.970766458Z] Daemon shutdown complete

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-21 19:43:43 +01:00
Paweł Gronowski c6ca7d49f9 Revert "daemon/command: don't make notifyReady(), notifyStopping() asynchronous"
This reverts commit 236fc46b5a.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-13 13:05:09 +01:00
Paweł Gronowski 5bdfdc0919 Revert "daemon/command: send notifyReady, notifyStopping synchronous"
This reverts commit 0e523625f8.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-13 13:05:07 +01:00
Paweł Gronowski ddb636c2bd Revert "daemon/command: add support for sd_notify "reload" notifications"
This reverts commit af18206630.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-02-13 13:05:06 +01:00
Sebastiaan van Stijn b8c6046f74 daemon: allow service registration on Windows with missing system dependencies
Before b0c8ff7d0c, system validation would
not take place until the daemon was actually started. This allowed (on
Windows) (un)registering the system service (`dockerd --register-service`,
`dockerd --unregister-service`) before installing other system requirements
(most notably, the Windows Containers feature).

This patch changes the behavior to allow this scenario; we perform validation
when explicitly requested (through the `--validate` flag), and perform the
same validation when starting the daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-05 21:20:50 +01:00
Cory SniderandSebastiaan van Stijn af18206630 daemon/command: add support for sd_notify "reload" notifications
commit f74b856e1a added an [ExecReload] to
the systemd unit, which allows users to signal the daemon to reload its
config through systemd (`systemctl reload docker.service`).

While reloading works, systemd expects the `ExecReload` command to be
synchronous, so that it knows when the reload completes, and can account
for this when managing dependent services.

> Note however that reloading a daemon by enqueuing a signal (...) is usually
> not a good choice, because this is an asynchronous operation and hence not
> suitable when ordering reloads of multiple services against each other.

Systemd 253 introduced a new Type (Type=notify-reload, see [systemd#25916]),
which allows setting a "ReloadSignal" instead, if the service supports
it by including a [MONOTONIC_USEC] value in its "RELOADING=1"
notifications.

This patch:

- adds reload notifications to the daemon to notify when the daemon got
  signaled to reload its configuration see [sd_notify(3)].
- appends a [MONOTONIC_USEC] value to the reload notification to support
  systemd 253's notify-reload protocol. This is backwards-compatible
  with older systemd releases as the systemd service manager ignores
  unknown assignments in notifications.
- adds a `notifyReady` callback to notify when the reload finished,
  which we currently send regardless if the reload was successful or
  failed (which could be due to an invalid config).

[ExecReload]: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecReload=
[systemd#25916]: https://github.com/systemd/systemd/pull/25916
[MONOTONIC_USEC]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#MONOTONIC_USEC=…
[sd_notify(3)]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#RELOADING=1

Signed-off-by: Cory Snider <csnider@mirantis.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-03 12:25:25 -05:00
Sebastiaan van Stijn 0e523625f8 daemon/command: send notifyReady, notifyStopping synchronous
These were called in a goroutine, likely to prevent them from affecting
performance, but doing so also means that there's no promise that the
notifications were actually sent before we continue.

Summarising the discussion from [PR 47358]:

These calls should not be particularly heavy-weight; They open a UNIX datagram
socket, write and close. (see the [go-systemd] implementation), and it's
unlikely these calls would block for a significant length of time unless pid 1
has become unresponsive, in which case you'd have much bigger problems. These
should be lightweight and fast as we can't imagine many C programs would be going
through the trouble of invoking `sd_notify()` in a background thread. Note that
the syslog API is also very similar: apps log by sending unixgrams to the `/dev/log`
socket.

[go-systemd]: https://github.com/coreos/go-systemd/blob/d5623bf85e8e73ae6352f78ee6b55a287619dd4e/daemon/sdnotify.go#L48-L84
[PR 47358]: https://github.com/moby/moby/pull/47358#discussion_r1488177590

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-03 12:24:08 -05:00
Sebastiaan van Stijn 236fc46b5a daemon/command: don't make notifyReady(), notifyStopping() asynchronous
Leave it to the consumer to decide whether these should be called in a
goroutine.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-02-03 12:24:08 -05:00
Sebastiaan van Stijn 8afb45b42f loadDaemonCliConfig: explicitly set default host
Setting the default host was implicitly handled in `normalizeHosts`; if
no hosts were provided, an empty entry was added to the list of hosts,
then passed through to `opts.ParseHost`, which handled an empty value
to set the default location (depending on TLS being enabled or XDG paths
to be used (when running with RootlessKit).

This patch makes the logic less magical:

- If no hosts are configured by the user (through CLI-flags or daemon.json),
  then we append the default location.
- The handling for TLS listeners is open-coded for now; we need to decide
  if we want to preserve this behavior (magically using TCP instead of a
  unix-socket or named pipe if TLS is enabled).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-26 16:51:41 +01:00
Sebastiaan van Stijn 4bc3a76891 daemon/command: slight cleanup of normalizeHosts
Use the slices package to remove duplicates.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-24 13:33:09 +01:00
hiroto.toyoda b0c8ff7d0c daemon: Check system requirements in newDaemonCLI
Move CheckSystem() call to newDaemonCLI() for earlier validation
of platform-specific requirements.

Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2026-01-20 03:28:25 +09:00
hiroto.toyoda 6dac897ad4 daemon: Check system requirements before initialization
Move checkSystem() call from inside NewDaemon() to cli.start()
to validate system requirements earlier in the startup process.

Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
2026-01-19 03:36:43 +09:00
Sebastiaan van Stijn 32190e99a3 Merge pull request #51624 from AkihiroSuda/fix-51601
cdi: read XDG_CONFIG_HOME/cdi and XDG_RUNTIME_DIR/cdi for rootless
2025-12-17 16:27:13 +01:00
Paweł Gronowski f44b5abf0e api: deprecate /grpc and /session endpoints
The /grpc and /session endpoints are now deprecated as the Engine has
been upgraded to properly support HTTP/2 and h2c requests, making these
specialized endpoints unnecessary.

These endpoints will be removed in the next major API version to
complete the cleanup.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:44:22 +01:00
Derek McGowan d210449d85 Natively support GRPC on the docker socket
Use the GRPC server when requests are for the grpc content type.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-12-09 21:03:04 +01:00
Akihiro Suda e29eaedf65 cdi: skip scanning non-readable dirs
This simplifies `dockerd-rootless.sh` by removing the workaround for
`CDI: Error associated with spec file /etc/cdi: failed to monitor for changes: permission denied`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-12-02 02:30:14 +09:00
Akihiro Suda cd4397b4dc cdi: read XDG_CONFIG_HOME/cdi and XDG_RUNTIME_DIR/cdi for rootless
Fix issue 51601

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-12-02 02:30:14 +09:00
Cory Snider 4535d63c91 daemon: install OpenCensus-to-OTEL trace bridge
Export trace spans from the github.com/microsoft/hcsshim module, which
is instrumented with OpenCensus, to the daemon's OpenTelemetry exporter
to provide more visibility into Windows container lifecycle operations.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-11-13 15:00:05 -05:00
Vigilans d192a63467 daemon: Ensure buildkit created container's isolation mode consistent with daemon's config
- Introduced DefaultIsolation method in the Daemon to return the daemon configured isolation mode for Windows.

Signed-off-by: Vigilans <vigilans@foxmail.com>
2025-11-10 16:33:14 +01:00
Sebastiaan van Stijn d9a03a374f daemon: consolidate "log-level" and "log-format" options and flags
The `LogLevel` and `LogFormat` options were defined in two locations;

- in the `daemon/commands.daemonOptions` struct.
- in the `daemon/config.Config` (`CommonConfig`) struct.

While we may need some options-struct to initialize the daemon, we currently
don't and the separate structs means they have to be kept in sync, and for
flags to be distributed across multiple places.

Note that some flags will not be configurable in the config-file (such as
the path of the config-file itself), so those options will need to have a
separate struct (which may still live in the `daemon/config` package).

This patch;

- Removes the `LogLevel` and `LogFormat` from `daemon/commands.daemonOptions`
  to `daemon/config.CommonConfig`.
- Adds a bare-bones `stringVar` implementation using generics to allow using
  strong-typed string values to be used for flags.
- Moves the flags together with the other flags in `installCommonConfigFlags`.
- Sets the default options in the `Config` struct.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-16 10:02:47 +02:00
Sebastiaan van Stijn 4e6c955e78 daemon/command: configureDaemonLogs: don't panic
Return an error instead of panicking.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-16 10:02:46 +02:00
Sebastiaan van Stijn c73fe6d26e daemon/config: move daemon log-config to a separate struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-16 10:02:43 +02:00
Sebastiaan van Stijn c584855329 daemon/command: configureProxyEnv: accept smaller struct
Also pass through the context

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-16 01:27:20 +02:00
Sebastiaan van Stijn e46a991dc5 api: remove unused DefaultVersion, MinSupportedAPIVersion consts
These consts are no longer used, and separate consts were added in both
the client and daemon packages;

- client: 41da5700a4
- daemon: a632b8495b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-04 07:30:35 -05: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
Sebastiaan van Stijn d761d9d358 pkg/rootless: move to daemon/internal
This package is used internally by the daemon, and was only used out
side of the daemon by pkg/plugins (for which we still need to look
where it should be kept).

Making it internal because it's trivial to implement if needed by
anyone. The only reason it's a package is to keep it central, and
to make it easier to discover where we have rootlesskit-specific
codepaths in our codebase.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 22:04:39 +02:00
Sebastiaan van Stijn 75bc4c5292 daemon/server/router/container: request sysInfo from daemon / backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 18:32:14 +02:00