Commit Graph

52053 Commits

Author SHA1 Message Date
CrazyMax
f410dbda88 dockerfile: dind target to build docker image for testing
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-08 11:48:33 +02:00
Rob Murray
9ba5c5d70e Merge pull request #49732 from robmry/nftables_primitives
Add utils for manipulating nftables rules
2025-04-08 09:25:41 +01:00
Akihiro Suda
3509feb1a5 Merge pull request #49763 from thaJeztah/registry_wire_up_contexts
registry: wire up contexts in some places, and remove some intermediate vars
2025-04-08 16:14:31 +09:00
Sebastiaan van Stijn
185651d26b Merge pull request #49767 from thaJeztah/vendor_atomicwriter
vendor: github.com/moby/sys/atomicwriter v0.1.0
2025-04-07 19:17:02 +02:00
Paweł Gronowski
ebc6c065d2 Merge pull request #49761 from robmry/add_info_firewallbackend
Add Info.FirewallBackend
2025-04-07 17:00:45 +00:00
Paweł Gronowski
83278485c0 Merge pull request #49734 from Shaggy84675/49709-fix_system_cpu_usage_stat
Fix docker stats parsing with large amount of interrupts
2025-04-07 16:41:25 +00:00
Rob Murray
a0a86d0982 Add Info.FirewallBackend
Report FirewallBackend in "docker info".

It's currently "iptables" or "iptables+firewalld" on Linux, and
omitted on Windows.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-04-07 16:56:49 +01:00
Sebastiaan van Stijn
25a80bd48e vendor: github.com/moby/sys/atomicwriter v0.1.0
no changes in vendored files

full diff: https://github.com/moby/sys/compare/6e2523cbf3a1...atomicwriter/v0.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 17:44:43 +02:00
Paweł Gronowski
d7d91b6bc5 Merge pull request #49764 from akerouanton/fix-TestNetworkStore-TestEndpointStore
libnet: de-flake TestEndpointStore and TestNetworkStore
2025-04-07 15:31:16 +00:00
Sebastiaan van Stijn
96601d1211 Merge pull request #49586 from vvoland/image-inspect-platform
image/inspect: Add platform selection
2025-04-07 16:29:57 +02:00
Albin Kerouanton
4eebd2c920 libnet: TestNetworkStore: replace assert.Equal with Check
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-07 16:25:00 +02:00
Patrik Leifert
e22d04e8a9 Improve CPU usage parsing and error reporting
This fix address issues where the scanner was unable to properly parse longer outputs from /proc/stat. This could happen on an ARM machine with large amount of CPU cores (and interrupts). By switching to reader we have more control over data parsing and dump unnecessary data

Signed-off-by: Patrik Leifert <patrikleifert@hotmail.com>
2025-04-07 16:19:02 +02:00
Albin Kerouanton
40650c6982 libnet: de-flake TestNetworkStore
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-07 16:03:36 +02:00
Albin Kerouanton
1c79c893b1 libnet: de-flake TestEndpointStore
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-07 16:03:03 +02:00
Paweł Gronowski
d9fd0c2db4 Merge pull request #49746 from vvoland/c8d-pull-progress-all
c8d/pull: Show progress for non-layer blobs
2025-04-07 12:40:46 +00:00
Sebastiaan van Stijn
8a5f141b0e registry: Service.lookupV2Endpoints: wire-up context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 13:36:21 +02:00
Sebastiaan van Stijn
9d8c8382d3 registry: authorizeClient: wire-up context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 13:35:03 +02:00
Sebastiaan van Stijn
8b920b2812 registry: loginV2: wire-up context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 13:35:03 +02:00
Sebastiaan van Stijn
4642704ed7 registry: newTransport: remove intermediate var
Align closer to other code doing the same.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 13:35:03 +02:00
Paweł Gronowski
7acef8101e c8d/pull: Show progress for non-layer blobs
Use the same logic as push for determining whether a progress should be
shown for a blob.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-04-07 13:31:04 +02:00
Paweł Gronowski
da3b31fb2c Merge pull request #49736 from akerouanton/cache-endpoint-in-memory
libnet: Controller: cache networks & endpoints in-memory
2025-04-07 10:00:36 +00:00
Paweł Gronowski
4f7588f6ad Merge pull request #49724 from akerouanton/fix-duplicated-port-mappings
libnet: fix duplicated port mappings in overlay networks
2025-04-07 09:57:38 +00:00
Sebastiaan van Stijn
c95e17638f Merge pull request #49757 from thaJeztah/archive_fix_linting
pkg/archive: fix linting issues
2025-04-07 10:18:03 +02:00
Akihiro Suda
b3bafd4b78 Merge pull request #49753 from thaJeztah/idtools_replace
pkg/idtools: MkdirAllAndChownNew: improve deprecation message
2025-04-07 09:00:46 +01:00
Akihiro Suda
e7ab601ab9 Merge pull request #49750 from thaJeztah/bump_go_cmp
vendor: github.com/google/go-cmp v0.7.0
2025-04-07 08:59:43 +01:00
Sebastiaan van Stijn
b3791dea92 pkg/archive: fix linting issues
fix "struct literal uses unkeyed fields" (govet)

    pkg/archive/changes_test.go:123:18: composites: github.com/docker/docker/pkg/archive.Change struct literal uses unkeyed fields (govet)
        modifyChange := Change{"change", ChangeModify}
                        ^
    pkg/archive/changes_test.go:128:15: composites: github.com/docker/docker/pkg/archive.Change struct literal uses unkeyed fields (govet)
        addChange := Change{"change", ChangeAdd}
                     ^
    ...

fix various variables that shadowed types

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-07 08:48:53 +02:00
Akihiro Suda
27568e54ce Merge pull request #49751 from thaJeztah/bump_compress
vendor: github.com/klauspost/compress v1.18.0
2025-04-07 04:52:12 +01:00
Sebastiaan van Stijn
a427477220 pkg/idtools: MkdirAllAndChownNew: improve deprecation message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-06 13:02:52 +02:00
Sebastiaan van Stijn
a91bcc677b vendor: github.com/klauspost/compress v1.18.0
full diff: https://github.com/klauspost/compress/compare/v1.17.11...v1.18.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-05 16:44:10 +02:00
Sebastiaan van Stijn
2c54f6f316 vendor: github.com/google/go-cmp v0.7.0
full diff: https://github.com/google/go-cmp/v0.6.0...v0.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-05 16:42:24 +02:00
Sebastiaan van Stijn
6cbca96bfa Merge pull request #49748 from thaJeztah/migrate_atomicwriter
deprecate pkg/atomicwriter, migrate to github.com/moby/sys/atomicwriter
2025-04-05 11:01:16 +02:00
Sebastiaan van Stijn
79b22645fc Merge pull request #49737 from thaJeztah/bump_golang_1.23.8
update to go1.23.8 (fix CVE-2025-22871)
2025-04-05 11:00:11 +02:00
Sebastiaan van Stijn
6422ff2804 deprecate pkg/atomicwriter, migrate to github.com/moby/sys/atomicwriter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-04 23:07:00 +02:00
Sebastiaan van Stijn
872b6d5df9 Merge pull request #49738 from thaJeztah/bump_cdi
vendor: tags.cncf.io/container-device-interface v1.0.1
2025-04-04 22:43:21 +02:00
Sebastiaan van Stijn
d7b743b856 Merge pull request #49741 from thaJeztah/atomicwriter_stricter_validate
pkg/atomicwriter: disallow symlinks for now, add more tests and touch-up GoDoc
2025-04-04 20:11:23 +02:00
Sebastiaan van Stijn
43b7c78cbd Merge pull request #49566 from dmcgowan/update-moby-user-idtools
Update `github.com/moby/sys/user` and use of idtools
2025-04-04 18:31:19 +02:00
Sebastiaan van Stijn
5ea21c927c Merge pull request #49745 from thaJeztah/registry_cleanup_step3
registry: wire up context in some places
2025-04-04 17:43:49 +02:00
Sebastiaan van Stijn
f1ec5bf14f pkg/idtools: remove tests already covered in moby/sys/user
Removes all tests, except for TestGetRootUIDGID and TestToContainer, which
are the only once that have a local implementation that's not covered.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-04 08:24:09 -07:00
Derek McGowan
3fc36bcac4 Update daemon to use moby sys/user identity mapping
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-04 08:24:09 -07:00
Derek McGowan
b5c99c0e95 Update moby/sys/user to version which includes mapping
Update idtools to use Mkdir funcs from moby sys/user package
Add deprecation exception to golanci until move off idtools is complete

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-04 08:22:05 -07:00
Sebastiaan van Stijn
0a83a476d8 registry: v1Endpoint.ping: pass through context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-04 12:59:42 +02:00
Sebastiaan van Stijn
2a272a0c5d registry: newV1Endpoint: pass through context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-04 12:59:42 +02:00
Sebastiaan van Stijn
f158d2e809 registry: ReadCertsDirectory: internalize, and pass context
- Split the implementation from the exported function (exported
  function is still used by the CLI for Docker Content Trust).
- Pass through context to allow handling context-cancellation
  once wired up in callers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-04 12:59:36 +02:00
Sebastiaan van Stijn
11bf52e9e3 Merge pull request #49739 from thaJeztah/registry_cleanup_step2
registry: minor fixes and cleanups
2025-04-04 12:30:52 +02:00
Albin Kerouanton
51d7f95c4b libnet: remove struct endpointCnt
endpointCnt is a refcounter used to track how many endpoints use a
network, and how many networks references a config-only network. It's
stored separately from the network.

This is only used to determine if a network can be removed.

This commit removes the `endpointCnt` struct and all its references. The
refcounter is replaced by two lookups in the newly introduced `networks`
and `endpoints` caches added to the `Controller`.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-04 11:21:17 +02:00
Paweł Gronowski
68451d3c99 Merge pull request #49650 from jsternberg/containerd-dangling-image-on-load
containerd: ensure overwritten images from load are left dangling
2025-04-04 09:14:38 +00:00
Albin Kerouanton
d377cd3810 libnet: Controller: cache networks in-memory
The `Controller`'s store is used by:

- `deleteFromStore`
- `getNetworks`
- `getNetworksFromStore`
- `updateToStore`
- … and other methods that can't store / delete / retrieve a Network

Calls to `updateToStore` and `deleteFromStore` have been replaced with
`upsertNetwork` and `deleteNetwork`.

Both `getNetworks` and `getNetworksFromStore` call `cacheNetwork` to
ensure networks loaded from the datastore are kept in-memory.

Finally, `sandboxRestore` was instantiating `Network` itself. These are
cached too.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-04 10:03:02 +02:00
Albin Kerouanton
cc8bd2016e libnet: Controller: cache endpoints in-memory
The `Controller`'s store is used by:

- `deleteFromStore`
- `getEndpointFromStore`
- `getEndpointsFromStore`
- `updateToStore`
- … and other methods that can't store / delete / retrieve an Endpoint

Calls to `updateToStore` and `deleteFromStore` have been replaced with
`upsertEndpoint` and `deleteEndpoint`.

Both `getEndpointFromStore` and `getEndpointsFromStore` call
`cacheEndpoint` to ensure endpoints loaded from the datastore are kept
in-memory.

Finally, `sandboxRestore` was instantiating `Endpoint` itself. These are
cached too.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-04-04 10:03:02 +02:00
Sebastiaan van Stijn
4ad6854eb3 Merge pull request #49727 from robmry/rootlesskit_iptables_check
Rootless setup: check for module nf_tables
2025-04-04 01:06:14 +02:00
Sebastiaan van Stijn
c6cdfbf495 pkg/atomicwriter: return early if parent directory is invalid
Rewrite `validateDestination` to first check if the destination path
exists. This slightly simplifies the logic (allowing returning
early in each step of the validation) and slightly improves the
error produced.

Before this, the error confusingly would mention the full path
not being a directory. While this _does_ match what `os.Writefile`
would return, it's .. confusing:

    failed to stat output path: lstat ./not-a-dir/new-file.txt: not a directory

After this, the error would mention the directory that doesn't exist:

    invalid output path: stat ./not-a-dir: not a directory

A slight optimization is made as well, now checking for _both_ "."
and ".." as special case, as either path should exist given any current
working directory (unless the working directory has been deleted, but we'd
fail further down the line).

With this change in order, we can also merge `validateFileMode` into
`validateDestination`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-03 21:57:13 +02:00