Commit Graph

9061 Commits

Author SHA1 Message Date
Derek McGowan
90f9ce14f1 Move libcontainerd to daemon/internal/libcontainerd
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:29:12 -07:00
Derek McGowan
3ee8c1e3a9 Move libcontainerd/types to daemon/internal/libcontainerd/types
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:56 -07:00
Derek McGowan
841a369b8f Move libcontainerd/supervisor to daemon/internal/libcontainerd/supervisor
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:40 -07:00
Derek McGowan
fe959261d3 Move libcontainerd/shimopts to daemon/internal/libcontainerd/shimopts
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:24 -07:00
Derek McGowan
4e8bd050bf Move libcontainerd/remote to daemon/internal/libcontainerd/remote
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:08 -07:00
Derek McGowan
dd1656e6bc Move libcontainerd/queue to daemon/internal/libcontainerd/queue
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:52 -07:00
Derek McGowan
6835f367e5 Move libcontainerd/local to daemon/internal/libcontainerd/local
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:36 -07:00
Derek McGowan
5419eb1efc Move container to daemon/container
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:21 -07:00
Derek McGowan
a02ba3c7df Move container/stream to daemon/internal/stream
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:05 -07:00
Derek McGowan
9d9cb00d50 Move container/stream/bytespipe to daemon/internal/stream/bytespipe
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:26:49 -07:00
Derek McGowan
3581b982f7 Move plugin to daemon/pkg/plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:26:33 -07:00
Derek McGowan
1c700c876f Move plugin/v2 to daemon/pkg/plugin/v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:26:17 -07:00
Derek McGowan
f5ceed8719 Move plugin/executor/containerd to daemon/internal/plugin/executor/containerd
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:26:01 -07:00
Derek McGowan
0b2582dc8f Move internal/metrics to daemon/internal/metrics
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:25:45 -07:00
Derek McGowan
87238882e0 Move api/server to daemon/server
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:18:20 -07:00
Derek McGowan
3a6e3f85c6 Move api/server/backend/build to daemon/build
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:18:05 -07:00
Derek McGowan
79f802d46a Move api/server/httputils to daemon/server/httputils
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:49 -07:00
Derek McGowan
c7a87f0dee Move api/server/httpstatus to daemon/server/httpstatus
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:33 -07:00
Derek McGowan
d64bd2cceb Move api/server/middleware to daemon/server/middleware
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:18 -07:00
Derek McGowan
72a020fcd8 Move api/server/router to daemon/server/router
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:17:02 -07:00
Derek McGowan
f293628f55 Move api/server/router/volume to daemon/server/router/volume
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:46 -07:00
Derek McGowan
15c8007064 Move api/server/router/system to daemon/server/router/system
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:31 -07:00
Derek McGowan
45172bbf23 Move api/server/router/swarm to daemon/server/router/swarm
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:15 -07:00
Derek McGowan
f6ba5a5241 Move api/server/router/session to daemon/server/router/session
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:16:00 -07:00
Derek McGowan
3eb5fe0277 Move api/server/router/plugin to daemon/server/router/plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:15:44 -07:00
Derek McGowan
baa58ddc6a Move api/server/router/network to daemon/server/router/network
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:15:28 -07:00
Derek McGowan
0cbb4ac8e6 Move api/server/router/image to daemon/server/router/image
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:15:13 -07:00
Derek McGowan
a063389af7 Move api/server/router/grpc to daemon/server/router/grpc
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:14:58 -07:00
Derek McGowan
9ff489863c Move api/server/router/distribution to daemon/server/router/distribution
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:14:42 -07:00
Derek McGowan
ced7798ed8 Move api/server/router/debug to daemon/server/router/debug
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:14:26 -07:00
Derek McGowan
3a9db5fbd6 Move api/server/router/container to daemon/server/router/container
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:14:11 -07:00
Derek McGowan
d6136b660f Move api/server/router/checkpoint to daemon/server/router/checkpoint
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:13:55 -07:00
Derek McGowan
31b6886eb1 Move api/server/router/build to daemon/server/router/build
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 09:13:40 -07:00
Matthieu MOREL
6b8afec95b fix redefines-builtin-id from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:45 +00:00
Matthieu MOREL
90ab64cbda fix increment-decrement from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Matthieu MOREL
381d9d0723 fix use-errors-new from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Matthieu MOREL
369c8f828e fix var-declaration from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:24 +00: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
Paweł Gronowski
f8bd49525b Merge pull request #50224 from thaJeztah/faster_trim
daemon: LogContainerEventWithAttributes: minor optimisation
2025-06-20 16:31:32 +00:00
Sebastiaan van Stijn
775f50e821 Merge pull request #50233 from thaJeztah/validate_mirrors
daemon/config: Validate: add missing validation for registry mirrors and improve errors
2025-06-20 12:50:48 +02:00
Sebastiaan van Stijn
1d8545d60c daemon/config: Validate: add missing validation for registry mirrors
Validation of registry mirrors was performed during daemon startup,
but after the config-file was validated. As a result, the `--validate`
option would incorrectly print that the configuration was valid, but
the daemon would fail to start;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    configuration OK

    dockerd --config-file ./my-config.json
    # ...
    failed to start daemon: invalid mirror: no scheme specified for "example.com": must use either 'https://' or 'http://'

With this patch applied, validation is also performed as part of the
daemon config validation;

    echo '{"registry-mirrors":["example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    unable to configure the Docker daemon with file ./my-config.json: merged configuration validation from file and command line flags failed: invalid mirror: no scheme specified for "example.com": must use either 'https://' or 'http://'

    # fix the invalid config
    echo '{"registry-mirrors":["https://example.com"]}' > my-config.json
    dockerd --config-file ./my-config.json --validate
    configuration OK

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-19 14:22:11 +02:00
Sebastiaan van Stijn
062082ec9b daemon: containerStop: fix ordering of "stop" and "die" events
Commit 8e6cd44ce4 added synchronisation to
wait for the container's status to be updated in memory. However, since
952902efbc, a defer was used to produce
the container's "stop" event.

As a result of the sychronisation that was added, the "die" event would
now be produced before the "stop" event.

This patch moves the locking inside the defer to restore the previous
behavior.

Unfortunately the order of events is still not guaranteed, because events
are emited from multiple goroutines that don't have synchronisation between
them; this is something to look at for follow ups. This patch keeps the status
quo and should preserve the old behavior, which was "more" correct in most
cases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-18 20:42:52 +02:00
Sebastiaan van Stijn
d85513e1a3 daemon: LogContainerEventWithAttributes: minor optimisation
As we're only expecting a single `/` prefix to be trimmed from the
container name, it's better to use `TrimPrefix` than `TrimLeft`, as
`TrimPrefix` takes a cut-set to remove any character in the set.

Benchmarking both;

    BenchmarkTrimLeft-10      535364544    2.204  ns/op    0 B/op    0 allocs/op
    BenchmarkTrimPrefix-10   1000000000    0.3148 ns/op    0 B/op    0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-18 13:14:43 +02:00
Paweł Gronowski
9a9cade0df Merge pull request #50199 from vvoland/c8d-push-fixtag
c8d/push: Fix fallback single-manifest push not creating a tag
2025-06-13 13:42:50 +00:00
Paweł Gronowski
987b8a88a6 c8d/push: Extract shared push logic
Just a refactor of the previous commit to reduce duplication.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-13 14:51:18 +02:00
Paweł Gronowski
d9e7b86de4 c8d/push: Fix fallback single-manifest push not creating a tag
After pushing the multi-platform index fails due to missing content, we
retry with the single-platform manifest. While the target descriptor was
changed for the second push, the actual target digested reference still
pointed to the original multi-platform index. Obviously, with the
fallback that didn't really work correctly, because the multi-platform
index is not pushed.

This commit fixes the issue by updating the target reference to point to
the single-platform manifest.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-13 14:31:34 +02:00
Sebastiaan van Stijn
5dc1ccdfc8 Merge pull request #50136 from mabrarov/50133-container_stop_state_sync
fix: daemon: state of stopped container visible to other queries when container is stopped
2025-06-13 14:16:37 +02:00
Paweł Gronowski
72145a8ad2 Merge pull request #50146 from vvoland/image-list-containers
api/image/list: Return `Containers` count
2025-06-13 11:34:38 +00:00