Commit Graph

2271 Commits

Author SHA1 Message Date
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
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
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
Sebastiaan van Stijn
1745075b24 client: DiskUsage: rename fields to match API
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 17:06:53 -06:00
Sebastiaan van Stijn
dcfcfd33e9 client: cleanup and re-group interfaces
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 23:48:47 +01:00
Paweł Gronowski
217fd78905 Merge pull request #51412 from austinvazquez/use-regular-slice-for-disk-usage
api/types: use regular slices for disk usage types
2025-11-06 23:13:47 +01:00
Austin Vazquez
6881ae72c7 api/types: use regular slices for disk usage types
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-05 22:05:47 -06:00
Sebastiaan van Stijn
f76f1fc013 client: Client.ImageSave: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:10:59 +01:00
Sebastiaan van Stijn
d35d8ec81b client: Client.ContainerLogs: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:09:33 +01:00
Sebastiaan van Stijn
cc9969bfed client: Client.ServiceLogs: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:08:23 +01:00
Sebastiaan van Stijn
c5aedacb4f client: Client.ContainerExport: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:07:57 +01:00
Sebastiaan van Stijn
08cd02cab6 client: Client.ImageImport: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:07:52 +01:00
Sebastiaan van Stijn
849239cedf client: Client.ImageLoad: close reader on context cancellation
Use a cancelReadCloser to automatically close the reader when the context
is cancelled. Consumers are still recommended to manually close the reader,
but the cancelReadCloser makes the Close idempotent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 00:07:14 +01:00
Austin Vazquez
cc25d0ebd4 Merge pull request #51403 from thaJeztah/singularize_prune
client: singularize prune methods
2025-11-05 11:33:14 -06:00
Sebastiaan van Stijn
de9ab07188 client: ExecCreateOptions: change ConsoleSize to a ConsoleSize type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 15:53:28 +01:00
Sebastiaan van Stijn
443b548efa client: ExecCreate: rename Tty to TTY
Align with ExecStartOptions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 15:53:03 +01:00
Sebastiaan van Stijn
ebc1dfbb64 client: singularize prune methods
All methods are singular; while pruning will impact multiple items,
it's more consistent to use singular for all operations.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-05 15:48:02 +01:00
Paweł Gronowski
25f880c923 Merge pull request #51365 from SamStudio8/51364-dockersave
docker/save: stable timestamp for blobs/digest dir
2025-11-05 14:04:40 +01:00
Austin Vazquez
a69abdd90d api/types/system: add type specific usage fields to DiskUsage
This change adds type specific fields to `GET /system/df` endpoint with high level information of disk usage. This change also introduces `verbose` query to the endpoint so that detailed information is by default excluded unless queried to reduce memory consumption. The previous top level `DiskUsage` fields (`Images`, `Containers`, `Volumes` and `BuildCache`) are now deprecated and kept for backwards compatibility.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-11-03 16:34:26 -06:00
Sam Nicholls
668b546d2c docker/save: stable timestamp for blobs/digest dir
Writing the OCI manifest file to the blobs/digest dir will update the
directory mtime, producing a tar file containing a member with a
contemporary mtime. Exported tars for the same image will therefore have
different checksums.

Although this was previously addressed by overriding the mtime manually
to 0, this was done before the OCI manifest file was written. This
change simply moves the call to system.Chtimes to set the mtime of the
blobs/digest directory to 0 after writing the OCI manifest file.

This commit also updates the TestSaveCheckTimes integration test to
check the mtime of all members in the exported tar to ensure that all
mtime are not newer than img.Created or 0 (depending on whether the
containerd-snapshotter is disabled or enabled, respectively).

Signed-off-by: Sam Nicholls <sam.nicholls@nanoporetech.com>
2025-11-03 13:15:19 +00:00
Salim Dohri
9b749d7c85 integration-cli: migrate TestAPIStatsContainerNotFound to integration tests
Migrate TestAPIStatsContainerNotFound from the deprecated integration-cli
test suite to the modern integration test framework in integration/container.

The test verifies that the container stats API returns a NotFound error
for non-existent containers, testing both streaming and non-streaming modes.

Changes made:
- Migrated test to integration/container/stats_test.go using standard
  Go testing patterns
- Refactored to use test array pattern for better test organization
- Removed test from integration-cli/docker_api_stats_test.go
- Removed unused imports from integration-cli file
- Removed Windows skip as it may not be necessary

Signed-off-by: Salim Dohri <dohri.salim@gmail.com>
2025-11-02 10:46:22 +01:00
Austin Vazquez
a087d03e0c client: refactor create network api implementation to wrap options/results
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-30 23:45:18 -05:00
Sebastiaan van Stijn
d96f50518f Merge pull request #51359 from thaJeztah/move_version_types
api/types: move Version to api/types/system
2025-10-31 03:15:17 +01:00
Sebastiaan van Stijn
b77f2055f7 Merge pull request #51219 from ricardobranco777/selinux
integration/container: Make tests runnable on SELinux enabled daemon
2025-10-31 02:46:39 +01:00
Sebastiaan van Stijn
12c9de37e9 api/types: move Version to api/types/system
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 02:09:38 +01:00
Sebastiaan van Stijn
ebe464ea45 api/types: remove PushResult type, and move internal
This type was used as Aux message for docker push, was not documented,
and only present for Docker Content Trust (which is deprecated).

This patch removes it from the API module, and moves the type internal.
We can stop sending this Aux message once DCT is fully phased out.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-31 00:47:23 +01:00