Commit Graph

2294 Commits

Author SHA1 Message Date
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
1489cb3ae0 Merge pull request #51722 from vvoland/modernize
Modernize Go code
2025-12-16 12:38:36 +00:00
Rob Murray
25fbe6cd43 Merge pull request #51725 from robmry/max-api-1.53
Update client MaxAPIVersion to 1.53
2025-12-16 11:14:41 +00:00
Rob Murray
1e209e788b Continue to backfill empty PortBindings in API 1.53
- introduced by commit 0ca7ac3 ("daemon: backfill empty PBs
  slices for backward compat")

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-16 11:03:58 +00:00
Rob Murray
bdda339294 Merge pull request #51574 from 2003Aditya/TestAPINetworkInspectWithScope
migrate TestAPINetworkInspectWithScope to integration test
2025-12-15 20:53:15 +00:00
Paweł Gronowski
3df05205f4 modernize: Use range int
Added in Go 1.22

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:34 +01:00
Paweł Gronowski
a25907b485 modernize: Prefer strings.SplitSeq instead of Split
Avoids extra allocations. Added in Go 1.24.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Rob Murray
239a49d403 Merge pull request #51711 from robmry/nri-config-reload
NRI: config reload
2025-12-15 17:51:27 +00:00
Rob Murray
98d196b714 NRI: error on unsupported adjustment
Also error on eviction requests.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-15 14:08:02 +00:00
Rob Murray
ff553c5069 NRI: make config reloadable
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-15 13:59:09 +00:00
Aditya Mishra
29d5098ffd migrate TestAPINetworkInspectWithScope to integration test
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-12-13 23:24:31 +05:30
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
Rob Murray
10c0fc4de8 NRI: add TestNRIContainerCreateAddMount
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-12 14:28:49 +00: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
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
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
Rob Murray
322dda3908 NRI: add TestNRIContainerCreateEnvVarMod
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-12-10 10:30:49 +00: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
cc30833181 integration: increase timeout
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-12-08 12:39:14 +09:00
Rob Murray
1b99d36c4a Merge pull request #51564 from 2003Aditya/TestAPIImagesSizeCompatibility
integration: migrate TestAPIImagesSizeCompatibility to integration test
2025-12-05 16:26:18 +00:00
Sebastiaan van Stijn
587d38292b Merge pull request #51629 from vvoland/c8d-fix-images
c8d/inspect: Fix image inspect for incomplete images
2025-12-02 12:35:27 +01:00
Akihiro Suda
b9d18a107a integration: cdi: add TestEtcCDI to verify /etc/cdi is used in rootless mode
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-12-02 02:30:14 +09:00
Paweł Gronowski
2e3a23c8ec c8d/inspect: Fix image inspect for incomplete images
When inspecting multi-platform images where some layer blobs were
missing from the content store, the image inspect operation would return
too early causing some data (like config details or unpacked size) to be
omitted even though are available.

This ensures that `docker image inspect` returns as much information as
possible.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-01 17:38:45 +01:00
Rob Murray
7517464283 PublishAllPorts: don't crash with nil PortBindings
Introduced by commit 85b260f ("PublishAllPorts: create
port mappings for exposed ports").

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-11-29 19:43:30 +00:00
Aditya Mishra
87583c9029 integration: migrate TestAPIImagesSizeCompatibility to integration test
Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-29 00:28:44 +05:30
Albin Kerouanton
14a955db2f Revert "libnet: setupDNS: don't overwrite user-modified resolv.conf"
This reverts commit 7639e193ff.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-28 09:47:01 +01:00
Rob Murray
baf59d62d6 Merge pull request #51592 from robmry/sbleave_gw_config_error
Suppress errors from gateway re-config when disconnecting a network
2025-11-26 16:07:41 +00:00
Rob Murray
163cc95aea Add TestGatewayErrorOnNetDisconnect
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-11-26 14:45:18 +00:00
Rob Murray
a3c29e8996 Merge pull request #51455 from smerkviladze/add-windows-integration-tests
integration: add Windows network driver and isolation tests
2025-11-26 11:42:54 +00:00
Sopho Merkviladze
5a5d5b4c5f integration: add Windows network driver and isolation tests
Add integration tests for Windows container functionality focusing on network drivers and container isolation modes.

Signed-off-by: Sopho Merkviladze <smerkviladze@mirantis.com>
2025-11-26 13:35:19 +04:00
Rob Murray
56dda25227 Merge pull request #51507 from zhangguanzhang/fix-pause-restart
libnet: setupDNS: don't overwrite user-modified resolv.conf
2025-11-25 13:53:10 +00:00
zhangguanzhang
7639e193ff libnet: setupDNS: don't overwrite user-modified resolv.conf
Call resolvconf.UserModified() in sandbox.setupDNS() to check if
resolv.conf was manually modified before regenerating it during
container restart for non-host network modes.

Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-25 20:32:40 +08:00
Rob Murray
84a251d039 Allow configured address with no configured subnet
Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-11-24 14:14:27 +00:00
Sebastiaan van Stijn
cf7cc93529 Merge pull request #51498 from 2003Aditya/TestAPIImagesDelete
Test api images delete
2025-11-16 23:04:06 +01:00
Aditya Mishra
8f1134b46d integration/image: migrate TestAPIImagesDelete to the new integration test framework
Migrated TestAPIImagesDelete from the legacy integration-cli suite
(docker_api_images_test.go) to the new integration test framework under
integration/image/remove_test.go.

This update:
- Fixes ENV instruction syntax to use "ENV FOO=bar"
- Adds error type check using errdefs.IsNotFound for cleaner assertions
- Ensures consistent cleanup handling

Signed-off-by: Aditya Mishra <mishraaditya675@gmail.com>
2025-11-14 22:00:15 +05:30
Sebastiaan van Stijn
3e4a3cb03e integration: skip TestBuildWithHugeFile
We've seen various failures recently where GitHub actions runners are
running out of space. Skip this test for now.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-14 17:23:05 +01:00
Sebastiaan van Stijn
0af2962fdd daemon: reduce use of pointer-slices in backend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-13 20:52:15 +01:00
Albin Kerouanton
d494784654 Merge pull request #51495 from akerouanton/revert-a8b9eff90
libnet: create DNS records on sbJoin (if not agent node)
2025-11-13 20:02:28 +01:00
Albin Kerouanton
53ea70ea46 inte/networking: TestDisableIPv6OnInterface: add '-c1' to ping
If the DNS name still resolves to an IP address, and that address is
assigned to a running container, the ping command will run indefinitely
and the test suite will time out for 10 mins.

This is confusing, as it looks like a daemon hang, or a test suite hang,
whereas it's just a test failure. Add '-c1' to ping to make it return
immediately.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-13 18:42:11 +01:00
Albin Kerouanton
47bd247d4d inte/networking: test DNS resolution for non swarm-scoped nws
Previous commit reverted a faulty change that broke DNS resolution for
non swarm-scoped networks once a node has joined a Swarm cluster.

This commit adds an integration test to verify that we don't break DNS
resolution again.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-13 18:42:11 +01:00
Sebastiaan van Stijn
dae3650dcc client: rename/deprecate WithVersion, WithVersionFromEnv
Add WithAPIVersion and WithAPIVersionFromEnv to be more clear on
the intent, and to align with other related options and fields.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 22:39:05 +01:00
Sebastiaan van Stijn
db71c6a914 api/types/container: make HealthStatus a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:08:15 +01:00
Sebastiaan van Stijn
1fd87e9fdf api/types/container: make ContainerState a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 16:08:12 +01:00
Sebastiaan van Stijn
048ced8435 Merge pull request #51448 from akerouanton/stop-events-service
daemon: close EventsService on shutdown
2025-11-10 14:20:28 +01:00
Sebastiaan van Stijn
7aa036ef2e client: rename CheckpointDelete to CheckpointRemove, and add output struct
Align with other "delete" options, which are all named "remove".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:42:27 +01:00
Sebastiaan van Stijn
e2bdc51508 client: CheckpointCreate: add output struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:42:23 +01:00
Sebastiaan van Stijn
da25838fc3 client: CheckpointListResult: rename Checkpoints to Items
Align with other ListResult structs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 11:23:34 +01:00
Albin Kerouanton
d087d3c057 daemon: close EventsService on shutdown
On daemon shutdown, the HTTP server tries to gracefully shutdown for 5
seconds. If there's an open API connection to the '/events' endpoint, it
fails to do so as nothing interrupts that connection, thus forcing the
daemon to wait until that timeout is reached.

Add a Close method to the EventsService, and call it during daemon
shutdown. It'll close any events channel, signaling to the '/events'
handler to return and close the connection.

It now takes ~1s (or less) to shutdown the daemon when there's an active
'/events' connection, instead of 5.

Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
2025-11-09 22:38:59 +01:00
Sebastiaan van Stijn
52e19b6e6d Merge pull request #51402 from thaJeztah/cleanup_interfaces
client: cleanup and re-group interfaces
2025-11-07 00:53:54 +01:00