Commit Graph

52175 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
42d149e45d fix duplicate import, and force consistent alias for bolt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-22 11:31:10 +02:00
Sebastiaan van Stijn
972c3918c5 Merge pull request #43340 from thaJeztah/testing_remove_defers
testing: remove some defer cleanup in favor of test.Cleanup()
2025-04-22 09:43:12 +02:00
Akihiro Suda
c3a7df35e7 Merge pull request #49838 from thaJeztah/remotecontext_clean
builder/remotecontext: MakeGitContext: use "WithFields" for logs
2025-04-20 06:50:32 +09:00
Akihiro Suda
784da88b15 Merge pull request #49839 from thaJeztah/dockerfile_updates
Dockerfile: update cli to v28.1.1, buildx v0.33.0, compose v0.35.1, syntax: docker/dockerfile:1
2025-04-20 06:49:30 +09:00
Akihiro Suda
7305bf47b8 Merge pull request #49844 from thaJeztah/bump_tar_split
vendor: github.com/vbatts/tar-split v0.12.1
2025-04-20 06:48:40 +09:00
Sebastiaan van Stijn
eede75c9d4 testing: remove some defer cleanup in favor of test.Cleanup()
gotest.tools v3.0.1 and up support Go's native test.Cleanup(), which
means that manually calling the cleanup functions in a defer is no
longer needed.

Some of these could probably be replaced by Go's native `t.TempDir()`,
but keeping that for a follow-up exercise.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-19 16:35:24 +02:00
Sebastiaan van Stijn
e3a0f2e690 vendor: github.com/vbatts/tar-split v0.12.1
archive/tar: fix for CVE-2022-2879

full diff: https://github.com/vbatts/tar-split/compare/v0.11.6...v0.12.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-19 12:28:51 +02:00
Sebastiaan van Stijn
bcc720abde builder/remotecontext: MakeGitContext: use "WithFields" for logs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-18 18:11:40 +02:00
Sebastiaan van Stijn
2808e59f4c Dockerfile: update compose to v2.35.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-18 18:00:48 +02:00
Sebastiaan van Stijn
a75be33ba0 Dockerfile: update buildx to v0.23.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-18 18:00:48 +02:00
Sebastiaan van Stijn
dd36139b1a Dockerfile: update cli to v28.1.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-18 18:00:42 +02:00
Sebastiaan van Stijn
f1e3ed0c48 Dockerfile: don't pin syntax to 1.7
The syntax was pinned for 1.7 in f696e0d2a7
possibly because it was not yet promoted as "latest stable" at the
time.

I don't think we need to pin to an old version, and just go with
the latest, so that we can use the latest features provided.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-18 18:00:13 +02:00
Akihiro Suda
01f442b84d Merge pull request #49588 from thaJeztah/bump_go_build_tags
update go:build tags to go1.23 to align with vendor.mod
v28.1.1
2025-04-18 13:25:23 +09:00
Akihiro Suda
e03c0f03e7 Merge pull request #49834 from thaJeztah/cleanup_ignore
cleanup ignore files
2025-04-18 13:24:33 +09:00
Akihiro Suda
8dde918e77 Merge pull request #49837 from thaJeztah/bump_containerd_2.0.5
vendor: github.com/containerd/containerd v2.0.5, golang.org/x/oauth2 v0.29.0
2025-04-18 13:04:42 +09:00
Akihiro Suda
e70ce7a35b Merge pull request #49833 from vvoland/rootless-iptables-check
contrib/rootless-setuptool: Fix iptables detection
2025-04-18 08:56:51 +09:00
Sebastiaan van Stijn
fc8361c078 vendor: github.com/containerd/containerd v2.0.5
full diff: https://github.com/containerd/containerd/compare/v2.0.4...v2.0.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-17 22:01:00 +02:00
Sebastiaan van Stijn
62f51e4367 vendor: golang.org/x/oauth2 v0.29.0
notable changes

- oauth2.go: use a more straightforward return value
- oauth2: Deep copy context client in NewClient
- jws: improve fix for CVE-2025-22868

full diff: https://github.com/golang/oauth2/compare/v0.27.0...v0.29.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-17 22:00:44 +02:00
Sebastiaan van Stijn
bbbb0036df cleanup ignore files
- We now only use winresources for the dockerd binary, so we can
  reduce some uses of wildcards
- Use explicit ("/") to indicate these should only be ignored
  relative to the root of the repository and build-context
- Remove remnant ignore for rpm builds

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-17 19:25:47 +02:00
Paweł Gronowski
ead379a464 contrib/rootless-setuptool: Fix iptables detection
Fix a logical error in the rootless setup tool where the iptables error
handling was incorrectly placed. The code was setting
`faced_iptables_error=1` even when iptables was available, causing
unnecessary error messages and setup suggestions.

This patch correctly moves the error handling into the `else` branch so
that we only report iptables errors when the command is actually
unavailable.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-04-17 19:23:15 +02:00
Sebastiaan van Stijn
7c52c4d92e update go:build tags to go1.23 to align with vendor.mod
Go maintainers started to unconditionally update the minimum go version
for golang.org/x/ dependencies to go1.23, which means that we'll no longer
be able to support any version below that when updating those dependencies;

> all: upgrade go directive to at least 1.23.0 [generated]
>
> By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
> per the Go Release Policy (https://go.dev/doc/devel/release#policy).
>
> For golang/go#69095.

This updates our minimum version to go1.23, as we won't be able to maintain
compatibility with older versions because of the above.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-17 15:43:19 +02:00
Rob Murray
6573a13e4a Merge pull request #49827 from robmry/warn_no_ext_nameservers
Warn when no external DNS nameservers are found
2025-04-17 14:08:01 +01:00
Rob Murray
619f1ddd05 Warn when no external DNS nameservers are found
Since commit 925b484 ("No fallback nameservers for internal
resolver"), if the host's resolv.conf has no nameservers and
no servers are supplied via config, the internal resolver will
not use Google's DNS - so the container will not be able to
resolve external DNS requests.

That can happen when container's are "restart-always" and the
docker daemon starts before the host's DNS is configured.

So, to highlight the issue (which may not be an error, but
probably is), include a warning in the container's resolv.conf
file.

Also, log a warning - logs currently say "No non-localhost DNS
nameservers are left in resolv.conf. Using default external
servers". But, that's misleading because it's from an initial
resolv.conf setup, before the internal resolver configured without
those fallbacks - we'll drop the fallbacks completely once the
default bridge has an internal resolver).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-04-17 10:51:06 +01:00
Paweł Gronowski
3f46cadf39 Merge pull request #49805 from thaJeztah/vendor_goarchive
vendor: github.com/moby/go-archive v0.1.0
v28.1.0-rc.2 v28.1.0
2025-04-16 12:07:48 +00:00
Sebastiaan van Stijn
b57d41c4bf Merge pull request #49799 from thaJeztah/apparmor_cleanups
profiles/apparmor: add some optimisations and tests
2025-04-16 13:21:25 +02:00
Sebastiaan van Stijn
29edd17909 Merge pull request #49815 from z63d/docs-api-image-tarball-format
docs/api: update image tarball format
2025-04-16 13:05:21 +02:00
Sebastiaan van Stijn
fd550344b1 vendor: github.com/moby/go-archive v0.1.0
full diff: https://github.com/moby/go-archive/compare/21f3f3385ab7...v0.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-16 13:00:13 +02:00
Paweł Gronowski
2834da861b Merge pull request #49814 from thaJeztah/initlayer_rm_idtools
daemon/initlayer: Setup: remove uses of idtools.Identity
2025-04-16 09:42:35 +00:00
Paweł Gronowski
1f43ad3a16 Merge pull request #49782 from thaJeztah/container_rm_idtools
container: Container.SetupWorkingDirectory: remove use of pkg/idtools
2025-04-16 09:41:35 +00:00
Kaita Nakamura
b8067d159f docs/api: update image tarball format
Signed-off-by: Kaita Nakamura <kaita.nakamura0830@gmail.com>
2025-04-16 18:02:08 +09:00
Sebastiaan van Stijn
a38ca9a548 daemon/initlayer: Setup: remove uses of idtools.Identity
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-16 09:58:24 +02:00
Rob Murray
9c9a6cb941 Merge pull request #49812 from robmry/endpoint_count_for_downgrade
Store an endpoint count for networks, for downgrade
2025-04-15 21:59:50 +01:00
Rob Murray
380ded6309 Store an endpoint count for networks, for downgrade
Since commit 51d7f95 ("libnet: remove struct endpointCnt") an
endpoint count for networks has not been persisted.

But, on downgrade to a version older than that commit, the
missing field caused daemon startup to fail.

So, create the count in the store - it only needs to exist, it's
no longer maintained as a count of endpoints. On downgrade, the
count is probably zero anyway (the daemon is stopped), but the
older daemon fixes it up on startup if necessary.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-04-15 17:59:34 +01:00
Sebastiaan van Stijn
c58a765707 Merge pull request #49809 from crazy-max/buildkit-0.21.0
vendor: update buildkit to v0.21.0
2025-04-15 18:20:39 +02:00
CrazyMax
ae0331d8f5 vendor: update buildkit to v0.21.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-15 17:04:25 +02:00
Paweł Gronowski
b2d06baf9b Merge pull request #49806 from robmry/missing_firewaller_error_check
bridge: Add a missing error check for firewaller setup
2025-04-15 13:06:27 +00:00
Rob Murray
57bf7a8c70 bridge: Add a missing error check for firewaller setup
It got lost in commit 29e0db2 ("Factor out top-level iptables
setup into its own object").

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-04-15 12:05:10 +01:00
Paweł Gronowski
bb8fcf3031 Merge pull request #49802 from vvoland/TestStopContainerWithTimeout-noparallel
integration/TestStopContainerWithTimeout: Attempt to fix flakiness
2025-04-14 15:19:25 +00:00
Paweł Gronowski
c49ce64514 integration/TestStopContainerWithTimeout: Attempt to fix flakiness
Temporarily remove Parallel.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-04-14 12:31:52 +02:00
Akihiro Suda
aa51a79ef9 Merge pull request #49800 from thaJeztah/seccomp_stdlib
profiles/seccomp: use stdlib for asserting, remove "// import" comments
2025-04-13 00:51:57 +09:00
Sebastiaan van Stijn
ecde7b9b7c Merge pull request #49797 from jsternberg/buildkit-rc2
vendor: github.com/moby/buildkit v0.21.0-rc2
2025-04-12 14:25:17 +02:00
Sebastiaan van Stijn
7eda35fd05 profiles/apparmor: IsLoaded: optimize
- Use a bufio.Scanner to read the profiles
- Use strings.Cut

Before/After:

    BenchmarkIsLoaded-10  2258	    508049 ns/op    244266 B/op    10004 allocs/op
    BenchmarkIsLoaded-10  5680	    208703 ns/op      4264 B/op	       4 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:13 +02:00
Sebastiaan van Stijn
0462b5e318 profiles/apparmor: add BenchmarkIsLoaded
go test -bench=. ./profiles/apparmor/
    goos: linux
    goarch: arm64
    pkg: github.com/docker/docker/profiles/apparmor
    BenchmarkIsLoaded-10    	    2258	    508049 ns/op	  244266 B/op	   10004 allocs/op
    PASS
    ok  	github.com/docker/docker/profiles/apparmor	1.210s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:13 +02:00
Sebastiaan van Stijn
b23d267cb5 profiles/apparmor: add basic unit-test for IsLoaded
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:12 +02:00
Sebastiaan van Stijn
0dd5959eeb profiles/apparmor: InstallDefault: slight cleanup and optimization
The existing code was more complicated than needed. By default, the daemon
runs "unconfined", but we try to detect the current profile that's set.
When failing to do so (error, or detected profile is empty), we assume
the default ("unconfined").

This patch simplifies the logic;

- Set the default ("unconfined")
- Only update the default when we successfully found the current profile
  (no error occurred, and the profile is not empty).

While updating, also;

- Replaced use of `strings.SplitN` for `strings.Cut`, which is more
  efficient, and doesn't allocate.
- Move constructing the profileData closer to where it's used.
- Remove intermediate var.
- Combine defers and change the order (close file first, before removing),
  and suppress errors to keep linters happy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:12 +02:00
Sebastiaan van Stijn
0bb761698c profiles/apparmor: loadprofile: fix double command in error message
`exec.Cmd.Path` already contains the command that was executed, so we
were printing the command twice. However, `exec.Cmd` implements a stringer
interface, which provides a readable version of the command that was
executed, so use that instead. While updating, lso change backticks in
the error for regular quotes.

Before:

    running `/usr/sbin/apparmor_parser apparmor_parser -Kr /no/such/file` failed with output: Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
    Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
    Use --subdomainfs to override.

    error: exit status 1

After:

    running '/usr/sbin/apparmor_parser -Kr /no/such/file' failed with output: Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
    Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
    Use --subdomainfs to override.

    error: exit status 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:12 +02:00
Sebastiaan van Stijn
8e1c366773 profiles/apparmor: remove "// import" comments
We are considering moving the apparmor profile to a separate module,
so removing these comments in preparation. These comments are ignored
already when building in go module mode, so have little benefits.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 13:34:12 +02:00
Sebastiaan van Stijn
1fa6a46c5d profiles/seccomp: remove "// import" comments
We are considering moving the seccomp profile to a separate module,
so removing these comments in preparation. These comments are ignored
already when building in go module mode, so have little benefits.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 10:46:03 +02:00
Sebastiaan van Stijn
89604f1df1 profiles/seccomp: use stdlib for asserting
We are considering moving the seccomp profile to a separate module,
so reducing the list of dependencies for this package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-12 10:26:10 +02:00
Jonathan A. Sternberg
14623770e1 vendor: github.com/moby/buildkit v0.21.0-rc2
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-04-11 14:02:47 -05:00