Commit Graph

55271 Commits

Author SHA1 Message Date
Rob Murray
7c7a626e5d NRI: include in API Info response
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-15 10:36:05 +00:00
Rob Murray
f6b1488468 Bump API to v1.53
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-15 09:45:21 +00:00
Rob Murray
0c01da8ccc Merge pull request #51675 from robmry/nri-mounts
NRI: allow plugins to add mounts
2025-12-12 18:37:29 +00:00
Sebastiaan van Stijn
70aa2e2981 Merge pull request #51707 from thaJeztah/bump_runtime_tools
vendor: github.com/opencontainers/runtime-tools v0.9.1-0.20251111083745-e5b454202754
2025-12-12 17:10:01 +01:00
Rob Murray
10c0fc4de8 NRI: add TestNRIContainerCreateAddMount
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-12 14:28:49 +00:00
Rob Murray
a30301b28d NRI: allow plugins to add mounts
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-12 14:28:49 +00:00
Sebastiaan van Stijn
52f33797f3 vendor: github.com/opencontainers/runtime-tools v0.9.1-0.20251111083745-e5b454202754
last commit before it updated to runtime-spec v1.3.0

full diff: 0ea5ed0382...e5b4542027

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-12 14:45:48 +01:00
Rob Murray
4384364748 Merge pull request #51702 from thaJeztah/bump_wazero
vendor: github.com/tetratelabs/wazero v1.10.1
2025-12-12 12:18:09 +00:00
Paweł Gronowski
0a0245a31a Merge pull request #51700 from jschfflr/45939-nil-check-tx-cleanup
layer: Fix orphan creation in registerWithDescriptor
2025-12-12 11:44:46 +00:00
Jan Scheffler
70004549fb layer: Fix orphan creation in registerWithDescriptor
Start the metadata transaction before creating the overlay2 directory.
This ensures that if driver.Create() fails, we can properly cancel the
transaction. Previously, if StartTransaction() failed after driver.Create()
succeeded, the defer cleanup would not run (not registered yet), leaving
an orphaned overlay2 directory.

The fix reorders operations so that:
1. Transaction is started first (no filesystem changes yet)
2. Overlay2 directory is created second (transaction ready for cleanup)
3. Defer is registered after both succeed (tx is guaranteed non-nil)

If driver.Create() fails, the transaction is explicitly cancelled before
returning. The nil check for tx in the defer is no longer needed since
tx is guaranteed to exist when the defer runs.

Related to moby/moby#45939

Signed-off-by: Jan Scheffler <jan.scheffler@qodev.ai>
2025-12-12 09:44:04 +00:00
Paweł Gronowski
95baac6740 Merge pull request #51697 from thaJeztah/bump_cni_plugins
vendor: github.com/containernetworking/plugins v1.9.0
2025-12-12 09:39:02 +00:00
Sebastiaan van Stijn
413b4afcba vendor: github.com/tetratelabs/wazero v1.10.1
full diff: https://github.com/tetratelabs/wazero/compare/v0.9.0...v1.10.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-12 10:33:55 +01:00
Sebastiaan van Stijn
24bac4495e vendor: github.com/containernetworking/plugins v1.9.0
no changes in vendored code

includes a fix for CVE-2025-67499

full diff: https://github.com/containernetworking/plugins/compare/v1.8.0...v1.9.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-12 10:27:12 +01:00
Albin Kerouanton
3cba626582 Merge pull request #50744 from dmcgowan/add-grpc-support
Natively support gRPC on the docker socket
2025-12-12 10:25:15 +01:00
Paweł Gronowski
31184e608e Merge pull request #51692 from akerouanton/remove-dead-ctrs-on-startup
daemon: clean up dead containers on start
2025-12-11 20:45:23 +00:00
Paweł Gronowski
15473075fc Merge pull request #51694 from vvoland/containerd-extra-dial-opts
daemon: use WithExtraDialOpts for containerd client connection
2025-12-11 20:41:57 +00:00
Sebastiaan van Stijn
70298eb5b8 Merge pull request #51300 from rafaelcamelo31/50486_api_move_scripts
api: move scripts to generate and validate swagger to api module
2025-12-11 21:35:38 +01:00
Sebastiaan van Stijn
664c651a51 Merge pull request #51640 from AkihiroSuda/rm-dockerfile-install
rm -r hack/dockerfile/install
2025-12-11 21:08:15 +01:00
Paweł Gronowski
96fa55d054 Merge pull request #51416 from vvoland/fix-lima
gha/vm: Adjust lima template locators
2025-12-11 20:00:19 +00:00
Sebastiaan van Stijn
c266fc1b88 Merge pull request #51660 from corhere/doc/v25-eom
project: add End-of-maintenance date for 25.0
2025-12-11 20:51:49 +01:00
Albin Kerouanton
ec9315cd4f daemon: clean up dead containers on start
Stopping the Engine while a container with autoremove set is running may
leave behind dead containers on disk. These containers aren't reclaimed
on next start, appear as "dead" in `docker ps -a` and can't be
inspected or removed by the user.

This bug has existed since a long time but became user visible with
9f5f4f5a42. Prior to that commit,
containers with no rwlayer weren't added to the in-memory viewdb, so
they weren't visible in `docker ps -a`. However, some dangling files
would still live on disk (e.g. folder in /var/lib/docker/containers,
mount points, etc).

The underlying issue is that when the daemon stops, it tries to stop all
running containers and then closes the containerd client. This leaves a
small window of time where the Engine might receive 'task stop' events
from containerd, and trigger autoremove. If the containerd client is
closed in parallel, the Engine is unable to complete the removal,
leaving the container in 'dead' state. In such case, the Engine logs the
following error:

    cannot remove container "bcbc98b4f5c2b072eb3c4ca673fa1c222d2a8af00bf58eae0f37085b9724ea46": Canceled: grpc: the client connection is closing: context canceled

Solving the underlying issue would require complex changes to the
shutdown sequence. Moreover, the same issue could also happen if the
daemon crashes while it deletes a container. Thus, add a cleanup step
on daemon startup to remove these dead containers.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-12-11 13:40:23 -06:00
Paweł Gronowski
849afcc5be daemon: use WithExtraDialOpts for containerd client connection
Replace WithDialOpts with WithExtraDialOpts when creating containerd
clients to preserve the containerd client's default dial options while
adding our custom options.

Previously, using WithDialOpts would overwrite all of containerd's
default dial options, requiring us to sync them.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 20:26:08 +01:00
Paweł Gronowski
8dd2c72fb6 gha/vm: Update lima template locators
Fixes warning:
```
time="2025-11-06T11:22:30Z" level=warning msg="Template locator \"template://oraclelinux-8\" should be written \"template:oraclelinux-8\" since Lima v2.0"
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 19:55:22 +01:00
Paweł Gronowski
c84610c967 Merge pull request #51686 from vvoland/dev
Makefile: Add simple dev loop
2025-12-11 14:30:07 +00:00
Paweł Gronowski
786ec62b92 Merge pull request #51688 from vvoland/fix-branch-check
gha: Fix PR branch validation
2025-12-11 14:27:10 +00:00
Paweł Gronowski
5ce3964834 Merge pull request #51683 from thaJeztah/fix_nil_map
daemon: buildCreateEndpointOptions: fix panic with "publish all"
2025-12-11 14:19:34 +00:00
Paweł Gronowski
c74203adbb gha: Fix PR branch validation
Make it work with `docker-XYZ` branches.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 15:17:25 +01:00
Rafael Camelo
0666108ebf api: move scripts to generate and validate swagger to api module
Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

revert api/swagger.yaml to undo formatting

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

refactor(api): update Dockerfile and Makefile with newline at the EOF and use current best practices

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

refactor validations and swagger generation flow

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

shfmt

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

refactor generate-swagger-api.sh to use absolute path

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

add validate-api-swagger job for GitHub Actions

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

fix validate-api-swagger ci workflow

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>

update go version and redoc in api module

Signed-off-by: Rafael Camelo <rafaelcamelo31@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-11 15:16:47 +01:00
Paweł Gronowski
a97b330c6c Makefile: Add simple dev loop
Add a `dev` target which adds a convenient developer loop which
rebuilds and reruns the daemon after a SIGINT is received.

It can be exited by sending SIGINT (Ctrl+C) a couple times.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 14:37:10 +01:00
Sebastiaan van Stijn
a11c3b9a89 Merge pull request #51684 from akerouanton/disallow-ctr-port-0
daemon: disallow container port 0
2025-12-11 14:07:59 +01:00
Sebastiaan van Stijn
2a191665b8 daemon/container: Container.BackfillEmptyPBs: prevent nil map
Make sure PortBindings is not a nil-map to match the behavior
we have when creating a container;
c64b781df2/daemon/internal/runconfig/config.go (L30-L47)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-11 12:09:32 +01:00
Albin Kerouanton
43780fe40c daemon: disallow container port 0
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-12-11 11:07:42 +01:00
Sebastiaan van Stijn
695010ba2e daemon: buildCreateEndpointOptions: fix panic with "publish all"
This code was added in 85b260fba8, but didn't
account for maps.Clone returning a `nil` map if the map cloned was `nil`.

This could lead to a panic, similar to the panic that was fixed in
7517464283d29969c4d3615397b369abd99ce395;

    panic: assignment to entry in nil map

    goroutine 498 [running]:

    github.com/moby/moby/v2/daemon.buildPortsRelatedCreateEndpointOptions(0x400042f348, 0xaaaabcc8f458?, 0x40006feb40)
        /root/build-deb/engine/daemon/network.go:1047 +0x844
    github.com/moby/moby/v2/daemon.buildCreateEndpointOptions(0x400042f348, 0x4001015040, 0x400027d320, 0x40006feb40, {0x0, 0x0, 0x4001506cb8?})
        /root/build-deb/engine/daemon/network.go:988 +0x20c
    github.com/moby/moby/v2/daemon.(*Daemon).connectToNetwork(0x4000898008, {0xaaaabe21d9f8, 0x4000f12b10}, 0x400089a008, 0x400042f348, {0x400077a9f0, 0x6}, 0x400027d320)
        /root/build-deb/engine/daemon/container_operations.go:738 +0x66c
    github.com/moby/moby/v2/daemon.(*Daemon).allocateNetwork(0x4000898008, {0xaaaabe21d9f8, 0x4000f12b10}, 0x400089a008, 0x400042f348)
        /root/build-deb/engine/daemon/container_operations.go:421 +0x298
    github.com/moby/moby/v2/daemon.(*Daemon).initializeCreatedTask(0x4000898008, {0xaaaabe21d9f8, 0x4000f12b10}, 0x400089a008, {0xaaaabe23dc60, 0x4000eb21c8}, 0x400042f348, 0xaaaabd4db3df?)
        /root/build-deb/engine/daemon/start_linux.go:37 +0x260
    github.com/moby/moby/v2/daemon.(*Daemon).containerStart(0x4000898008, {0xaaaabe21d9c0, 0xaaaabfa05300}, 0x400089a008, 0x400042f348, {0x0, 0x0}, {0x0, 0x0}, 0x1)
        /root/build-deb/engine/daemon/start.go:242 +0xba8
    github.com/moby/moby/v2/daemon.(*Daemon).restore.func4(0x400042f348, 0x400117f1f0)
        /root/build-deb/engine/daemon/daemon.go:633 +0x308
    created by github.com/moby/moby/v2/daemon.(*Daemon).restore in goroutine 1
        /root/build-deb/engine/daemon/daemon.go:607 +0x5ec

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-11 10:11:15 +01:00
Rob Murray
8cf9e64738 NRI: report container state to plugins
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-10 17:49:28 +00:00
Rob Murray
c64b781df2 Merge pull request #51678 from robmry/nri-review-comments
NRI: minor cleanups
2025-12-10 17:07:36 +00:00
Rob Murray
dc1fe0be82 NRI: minor cleanups
Address some post-merge review comments.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-10 15:10:38 +00:00
Albin Kerouanton
07024223e2 Merge pull request #51674 from robmry/nri-env-vars
NRI: allow plugins to see/modify env vars
2025-12-10 15:52:42 +01:00
Sebastiaan van Stijn
186a5abedc Merge pull request #51664 from thaJeztah/integration_cli_updates
assorted test-changes in preparation of updating integration-cli CLI version
2025-12-10 13:21:56 +01:00
Rob Murray
322dda3908 NRI: add TestNRIContainerCreateEnvVarMod
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-10 10:30:49 +00:00
Rob Murray
b67f0c0449 NRI: add ContainerCreate hook, allow env-var adjustments
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-10 10:30:44 +00:00
Sebastiaan van Stijn
3a85f8df66 Merge pull request #51420 from AkihiroSuda/revert-5417
integration: increase timeout; gha/vm: update Lima to v2.0.2
2025-12-10 10:47:05 +01:00
Sebastiaan van Stijn
a7e55b9e4e Merge pull request #51625 from thaJeztah/less_reflect
libnetwork/options: GenerateFromModel: less reflection, and use generics
2025-12-10 01:58:03 +01:00
Sebastiaan van Stijn
565f7dce18 integration-cli: TestUserDefinedNetworkAlias: adjust for API versions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:26 +01:00
Sebastiaan van Stijn
93eb7962dc integration-cli: TestUserDefinedNetworkAlias: replace deprecated utils
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:26 +01:00
Sebastiaan van Stijn
83f17f77cf integration-cli: adjust some tests for API-specific event-types
Image create events were added in API 1.46, and filtered out in older
API versions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:26 +01:00
Sebastiaan van Stijn
35f1250685 integration-cli: use event-consts in some tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:51:23 +01:00
Sebastiaan van Stijn
33eb3b8d78 integration-cli: TestEventsFilterType: remove test for "build" events
Commit 6aea8c2591 updated this part of the
test to account for BuildKit now being used as default, which doesn't use
regular containers to "commit" to an image, and therefore doesn't produce
events as part of the build.

However, it changed it to filter for `build` type events, which .. don't
exist. The test passed because it only checked for number of events produced,
which is approximated by checking the number of lines in the output. In
this case, the output would be empty, so "events" was a slice of strings
with length 1; an empty string.

Given that BuildKit doesn't produce meaningful events to test for, we could
either disable BuildKit, to test the legacy builder, or just remove this
part of the test. Let's do the latter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:50:45 +01:00
Sebastiaan van Stijn
99066209a2 libnetwork/options: GenerateFromModel: use generics
Use generics so that the produced output is already in the right
type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:48:48 +01:00
Sebastiaan van Stijn
14c5cd377d libnetwork/options: GenerateFromModel: reduce reflection
Re-use some of the reflection results where possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-10 01:48:45 +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