Commit Graph

55244 Commits

Author SHA1 Message Date
Paweł Gronowski
08440b6ee8 Merge pull request #51830 from thaJeztah/29.x_backport_windows-network-none
[docker-29.x backport] daemon/libnetwork: Fix panic in findHNSEp when IP networks are nil
docker-v29.1.4
2026-01-08 16:57:22 +00:00
Paweł Gronowski
b0e62060b0 Merge pull request #51829 from thaJeztah/29.x_backport_fix-image-mount
[docker-29.x backport] daemon/volumes: More fs friendly image mount layer names
2026-01-08 16:57:12 +00:00
Sebastiaan van Stijn
515dbc8c71 Merge pull request #51826 from thaJeztah/29.x_backport_45939-init-layer-cleanup
[docker-29.x backport] layer: Clean up init layer if initialization fails
2026-01-08 17:24:06 +01:00
Sebastiaan van Stijn
adf3073cb6 Merge pull request #51825 from thaJeztah/29.x_backport_archive_rm_deprecated
[docker-29.x backport] remove uses of deprecated go-archive consts
2026-01-08 17:23:43 +01:00
Sebastiaan van Stijn
8b2c317218 Merge pull request #51824 from thaJeztah/29.x_backport_45939-rw-layer-cleanup
[docker-29.x backport] layer: Clean up RW layer if mount metadata save fails
2026-01-08 17:23:09 +01:00
Paweł Gronowski
3eca177282 daemon/libnetwork: Fix panic in findHNSEp when IP networks are nil
Can happen for `docker run --network none ...`

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit fadd8dc47c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 16:59:22 +01:00
Paweł Gronowski
c4f4c6765e daemon/volumes: More fs friendly image mount layer names
Hash the container ID, mount source and destination together to form a
layer name.

This ensures the generated names are filesystem-friendly and don't
exceed path length limits while maintaining uniqueness across different
mount points and containers.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit cb88c6ba10)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 16:56:18 +01:00
Sebastiaan van Stijn
f942bce11a Merge pull request #51821 from vvoland/51740-docker-29.x
[docker-29.x backport] vendor: github.com/moby/buildkit v0.26.3
2026-01-08 16:41:14 +01:00
Paweł Gronowski
a1f7fff7a9 daemon/layer_store: Use named return error for defer
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 26bb1af7e6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 11:00:00 +01:00
Jan Scheffler
0e600c7fc4 layer: Clean up init layer if initialization fails
Add cleanup for the init layer directory if any operation fails after
driver.CreateReadWrite() succeeds in initMount(). Previously, failures
in driver.Get(), initFunc(), or driver.Put() would leave an orphaned
overlay2 directory.

Related to moby/moby#45939

Signed-off-by: Jan Scheffler <jan.scheffler@qodev.ai>
(cherry picked from commit 3fdde529e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 11:00:00 +01:00
Sebastiaan van Stijn
734bb626e4 remove uses of deprecated go-archive consts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7239c72eca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 10:54:50 +01:00
Jan Scheffler
5eaae6db52 layer: Clean up RW layer if mount metadata save fails
Add cleanup for the RW layer directory if saveMount() fails after
driver.CreateReadWrite() succeeds. Previously, this failure path would
leave an orphaned overlay2 directory with no corresponding metadata.

Related to moby/moby#45939

Signed-off-by: Jan Scheffler <jan.scheffler@qodev.ai>
(cherry picked from commit d7a6250b91)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-08 10:49:11 +01:00
Jonathan A. Sternberg
8ebb104e36 vendor: github.com/moby/buildkit v0.26.3
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
(cherry picked from commit c63bf203bf)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-01-07 16:44:38 +01:00
Paweł Gronowski
fbf3ed25f8 Merge pull request #51703 from vvoland/51700-docker-29.x
[docker-29.x backport] layer: Fix orphan creation in registerWithDescriptor
docker-v29.1.3
2025-12-12 13:08:08 +00:00
Jan Scheffler
518779c90b 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>
(cherry picked from commit 70004549fb)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-12 12:45:16 +01:00
Sebastiaan van Stijn
ecf8643fe1 Merge pull request #51699 from vvoland/51697-docker-29.x
[docker-29.x backport] vendor: github.com/containernetworking/plugins v1.9.0
2025-12-12 11:38:17 +01:00
Sebastiaan van Stijn
5a99e1d1a4 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>
(cherry picked from commit 24bac4495e)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-12 10:39:19 +01:00
Sebastiaan van Stijn
bae170eeb7 Merge pull request #51695 from vvoland/51684-docker-29.x
[docker-29.x backport] daemon: disallow container port 0
2025-12-11 23:11:07 +01:00
Sebastiaan van Stijn
8f33623c5d Merge pull request #51691 from vvoland/51683-docker-29.x
[docker-29.x backport] daemon: buildCreateEndpointOptions: fix panic with "publish all"
2025-12-11 23:10:00 +01:00
Paweł Gronowski
bdc1e7b0fe Merge pull request #51693 from vvoland/51692-docker-29.x
[docker-29.x backport] daemon: clean up dead containers on start
2025-12-11 20:50:59 +00:00
Albin Kerouanton
298e2f7d52 daemon: disallow container port 0
Signed-off-by: Albin Kerouanton <albin.kerouanton@docker.com>
(cherry picked from commit 43780fe40c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 21:42:30 +01:00
Albin Kerouanton
3376758770 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>
(cherry picked from commit ec9315cd4f)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 20:55:04 +01:00
Sebastiaan van Stijn
bb2e099c3a 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>
(cherry picked from commit 2a191665b8)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 16:40:38 +01:00
Sebastiaan van Stijn
5898ee60f4 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>
(cherry picked from commit 695010ba2e)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 16:40:38 +01:00
Paweł Gronowski
05a5be917d Merge pull request #51689 from vvoland/51688-docker-29.x
[docker-29.x backport] gha: Fix PR branch validation
2025-12-11 15:39:25 +00:00
Paweł Gronowski
ab55325b58 gha: Fix PR branch validation
Make it work with `docker-XYZ` branches.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit c74203adbb)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 16:35:09 +01:00
Paweł Gronowski
5c69198edd Merge pull request #51685 from vvoland/sync-29.x
[docker-29.x] Move to `29.1`
2025-12-11 15:25:58 +00:00
Paweł Gronowski
cbaccdaf6d Merge tag 'docker-v29.1.2' into docker-29.x
v29.1.2
2025-12-11 13:38:34 +01:00
Paweł Gronowski
09d5128bff Merge tag 'docker-v29.1.1' into docker-29.x
v29.1.1
2025-12-11 13:38:32 +01:00
Paweł Gronowski
b54adb2d03 Merge tag 'docker-v29.1.0' into docker-29.x
v29.1.0

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-11 13:37:59 +01:00
Sebastiaan van Stijn
de45c2ae4f Merge pull request #51648 from vvoland/update-go
update to go1.25.5
docker-v29.1.2
2025-12-02 21:58:47 +01:00
Sebastiaan van Stijn
4212eb0abf Merge pull request #51650 from thaJeztah/bump_actions
gha: update actions/checkout@v6, actions/upload-artifact@v5, actions/download-artifact@v6
2025-12-02 21:28:40 +01:00
Paweł Gronowski
6f9d1ec3fb update to go1.25.5
These releases include 2 security fixes following the security policy:

- crypto/x509: excessive resource consumption in printing error string for host certificate validation

    Within HostnameError.Error(), when constructing an error string, there is no limit to the number of hosts that will be printed out.
    Furthermore, the error string is constructed by repeated string concatenation, leading to quadratic runtime.

    Therefore, a certificate provided by a malicious actor can result in excessive resource consumption.
    HostnameError.Error() now limits the number of hosts and utilizes strings.Builder when constructing an error string.

    Thanks to Philippe Antoine (Catena cyber) for reporting this issue.

    This is CVE-2025-61729 and Go issue https://go.dev/issue/76445.

- crypto/x509: excluded subdomain constraint does not restrict wildcard SANs

    An excluded subdomain constraint in a certificate chain does not restrict the
    usage of wildcard SANs in the leaf certificate. For example a constraint that
    excludes the subdomain test.example.com does not prevent a leaf certificate from
    claiming the SAN *.example.com.

    This is CVE-2025-61727 and Go issue https://go.dev/issue/76442.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.25.5

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-02 20:30:08 +01:00
Sebastiaan van Stijn
f132381992 Merge pull request #51649 from thaJeztah/bump_setup_action
gha: update to actions/setup-go@v6
2025-12-02 20:29:39 +01:00
Sebastiaan van Stijn
81d930f527 gha: update to actions/setup-go@v6
Includes a change to use go.dev/dl instead of storage.googleapis.com/golang
as fallback URL, because storage.googleapis.com/golang is deprecated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 20:07:34 +01:00
Sebastiaan van Stijn
7000f92763 gha: update actions/download-artifact@v6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 20:03:48 +01:00
Sebastiaan van Stijn
69963d84f8 gha: update actions/upload-artifact@v5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 20:02:48 +01:00
Sebastiaan van Stijn
43ed81ed85 gha: update actions/checkout@v6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 20:01:27 +01:00
Sebastiaan van Stijn
bced6f6100 Merge pull request #51647 from thaJeztah/bump_compress
vendor: github.com/klauspost/compress v1.18.2
2025-12-02 17:00:04 +01:00
Sebastiaan van Stijn
4b8f9dd251 vendor: github.com/klauspost/compress v1.18.2
No changes in vendored code

Fixes a regression in v1.18.1 that resulted in invalid flate/zip/gzip encoding.
The v1.18.1 tag has been retracted.

full diff: https://github.com/klauspost/compress/compare/v1.18.1...v1.18.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 16:45:38 +01:00
Paweł Gronowski
e4f1408738 Merge pull request #51628 from locnnil/patch-1
Dockerfile: Update buildx to 0.30.1
2025-12-02 15:23:36 +00:00
Paweł Gronowski
5ecc72679d Merge pull request #51645 from thaJeztah/api_relax_replace_check
hack/validate/module-replace: relax check
2025-12-02 15:23:02 +00:00
Sebastiaan van Stijn
7687298e0a hack/validate/module-replace: relax check
Do not require replace rules to be added if there's no code-changes
in the module. Note that changes in api/swagger.yaml may result in
changes in generated code, but this should be checked separate from
the swagger itself.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-12-02 16:14:07 +01:00
Paweł Gronowski
45be1a39b3 Merge pull request #51617 from vvoland/validate-share-image
gha/test-validate: Reuse the dev image
2025-12-02 15:13:03 +00:00
Lincoln Wallace
a828af4d8d Dockerfile: Update buildx to 0.30.1
Signed-off-by: Lincoln Wallace <lincoln.wallace@canonical.com>
2025-12-02 16:00:28 +01:00
Paweł Gronowski
616e53c12b Merge pull request #51633 from Xeeynamo/bump-runc-v134
Dockerfile: update runc binary to v1.3.4
2025-12-02 11:45:39 +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
Luciano Ciccariello
f97f234729 Dockerfile: update runc binary to v1.3.4
- release notes: https://github.com/opencontainers/runc/releases/tag/v1.4.0
- full diff: opencontainers/runc@v1.3.3...v1.4.0

This version bump aims to fix a regression in runc v1.3.3, which caused
/dev/shm to have inappropriate permissions exposed to containers:
* https://github.com/opencontainers/runc/issues/4971
* https://github.com/opencontainers/runc/pull/4976

Signed-off-by: Luciano Ciccariello <xeeynamo@hotmail.com>
2025-12-02 09:31:00 +00:00
Brian Goff
a1836eb283 Merge pull request #51631 from thaJeztah/fix_df_shared_usage
system: df: fix SharedUsage on non-containerd
2025-12-01 13:30:07 -08: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