48948 Commits

Author SHA1 Message Date
Austin Vazquez
0e655eaff2 Merge pull request #49321 from thaJeztah/25.0_backport_backport_gha_arm64
[25.0 backport] ci: switch from jenkins to gha for arm64 build and tests (and set correct go version for branch)
2025-01-28 10:08:23 -06:00
Sebastiaan van Stijn
b1d6fd957d gha: set arm64 GO_VERSION to 1.22.10
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6c832d05c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-28 13:43:02 +01:00
CrazyMax
7540f88434 ci: switch from jenkins to gha for arm64 build and tests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit 8c236de735)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-28 13:43:02 +01:00
Sebastiaan van Stijn
19dd685407 Merge pull request #49346 from austinvazquez/cherry-pick-f8a973ba4e7d4e5b90d5a89bb4a8633ceae26985-to-25.0
[25.0 backport] ci: update bake-action to v6
2025-01-28 13:42:11 +01:00
CrazyMax
f8d9617c43 ci(bin-image): fix bake build
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit d86920b9b3)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-28 04:50:37 +00:00
CrazyMax
bec5e8eed1 ci: update bake-action to v6
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
(cherry picked from commit f8a973ba4e)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-28 04:44:57 +00:00
Sebastiaan van Stijn
71907ca48e Merge pull request #49269 from austinvazquez/cherry-pick-update-runc-1.2.4-to-25.0
[25.0 backport] Dockerfile: update runc binary to v1.2.4
v25.0.8
2025-01-14 12:58:14 +01:00
Sebastiaan van Stijn
72f6828fd3 Merge pull request #49268 from austinvazquez/cherry-pick-update-containerd-1.7.25-to-25.0
[25.0 backport] Dockerfile: update containerd to v1.7.25
2025-01-13 19:43:04 +01:00
Sebastiaan van Stijn
fcb50183e4 Dockerfile: update runc binary to v1.2.4
This is the fourth patch release of the 1.2.z release branch of runc. It
includes a fix for a regression introduced in 1.2.0 related to the
default device list.

- Re-add tun/tap devices to built-in allowed devices lists.

 In runc 1.2.0 we removed these devices from the default allow-list
 (which were added seemingly by accident early in Docker's history) as
 a precaution in order to try to reduce the attack surface of device
 inodes available to most containers. At the time we thought
 that the vast majority of users using tun/tap would already be
 specifying what devices they need (such as by using --device with
 Docker/Podman) as opposed to doing the mknod manually, and thus
 there would've been no user-visible change.

 Unfortunately, it seems that this regressed a noticeable number of
 users (and not all higher-level tools provide easy ways to specify
 devices to allow) and so this change needed to be reverted. Users
 that do not need these devices are recommended to explicitly disable
 them by adding deny rules in their container configuration.

full diff: https://github.com/opencontainers/runc/compare/v1.2.3...v1.2.4
release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit aad7bcedd2)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-13 10:24:10 -07:00
Sebastiaan van Stijn
20af9f77a6 Dockerfile: update containerd to v1.7.25
release notes: https://github.com/containerd/containerd/releases/tag/v1.7.25
full diff: https://github.com/containerd/containerd/compare/v1.7.24...v1.7.25

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c12bfda3cd)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-13 10:14:14 -07:00
Austin Vazquez
eee2f6d0de Merge pull request #49173 from austinvazquez/cherry-pick-ec5c9e06e39a4e6d29700f4ca5376773fae57fa0-to-25.0
[25.0 backport] Dockerfile: update runc binary to v1.2.3
2024-12-31 12:32:51 -06:00
Sebastiaan van Stijn
7d20eee4fd Dockerfile: update runc binary to v1.2.3
This is the third patch release of the 1.2.z release branch of runc. It
primarily fixes some minor regressions introduced in 1.2.0.

- Fixed a regression in use of securejoin.MkdirAll, where multiple
  runc processes racing to create the same mountpoint in a shared rootfs
  would result in spurious EEXIST errors. In particular, this regression
  caused issues with BuildKit.
- Fixed a regression in eBPF support for pre-5.6 kernels after upgrading
  Cilium's eBPF library version to 0.16 in runc.

full diff: https://github.com/opencontainers/runc/compare/v1.2.2...v1.2.3
release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ec5c9e06e3)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-12-28 22:11:11 -07:00
Albin Kerouanton
d86f1d1cde Merge pull request #49112 from thaJeztah/25.0_backport_fix_setupIPChains_defer
[25.0 backport] libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
2024-12-16 21:26:06 +01:00
Sebastiaan van Stijn
eacc3610f9 libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
The output variable was renamed in 0503cf2510,
but that commit failed to change this defer, which was now checking the
wrong error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 01a55860c6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 16:54:55 +01:00
Akihiro Suda
5bd40c3b0a Merge pull request #49082 from thaJeztah/25.0_backport_bump_xx
[25.0 backport] update xx to v1.6.1 for compatibility with alpine 3.21
2024-12-16 13:52:25 +09:00
Sebastiaan van Stijn
842024e721 update xx to v1.6.1 for compatibility with alpine 3.21
This fixes compatibility with alpine 3.21

- Fix additional possible `xx-cc`/`xx-cargo` compatibility issue with Alpine 3.21
- Support for Alpine 3.21
- Fix `xx-verify` with `file` 5.46+
- Fix possible error taking lock in `xx-apk` in latest Alpine without `coreutils`

full diff: https://github.com/tonistiigi/xx/compare/v1.5.0...v1.6.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 89899b71a0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 00:44:42 +01:00
Sebastiaan van Stijn
96b8a34d2b Dockerfile: update xx to v1.5.0
full diff: https://github.com/tonistiigi/xx/compare/v1.4.0...v1.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c4ba1f4718)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 00:44:42 +01:00
Sebastiaan van Stijn
5ed63409a2 Dockerfile: update xx to v1.4.0
full diff: https://github.com/tonistiigi/xx/compare/v1.2.1...v1.4.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4f46c44725)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-13 00:44:41 +01:00
Sebastiaan van Stijn
81ac5dace5 Merge pull request #49048 from austinvazquez/cherry-pick-0e34b3956b6e95324d67517305a3376d36896490-to-25.0
[25.0] update to go1.22.10
2024-12-07 23:38:31 +01:00
Sebastiaan van Stijn
03885ae2c0 update to go1.22.10
go1.22.10 (released 2024-12-03) includes fixes to the runtime and the syscall
package. See the Go 1.22.10 milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.22.10+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.22.9...go1.22.10

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0e34b3956b)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-12-07 12:32:08 -07:00
Sebastiaan van Stijn
a39b701d10 Merge pull request #49029 from thaJeztah/25.0_backport_cdi-rootless
[25.0 backport] Dockerd rootless: make {/etc,/var/run}/cdi available
2024-12-04 15:17:59 +01:00
Rafael Fernández López
ddc8a15eb5 Dockerd rootless: make {/etc,/var/run}/cdi available
When dockerd is executed with the `dockerd-rootless.sh` script, make
/etc/cdi and /var/run/cdi available to the daemon if they exist.

This makes it possible to enable the CDI integration in rootless mode.

Fixes: #47676

Signed-off-by: Rafael Fernández López <ereslibre@ereslibre.es>
(cherry picked from commit 4e30acb63f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-04 12:04:53 +01:00
Sebastiaan van Stijn
be15fac5cd Merge pull request #49011 from vvoland/49009-25.0
[25.0 backport] c8d/tag: Don't log a warning if the source image is not dangling
2024-12-02 13:32:21 +01:00
Paweł Gronowski
6648f3a10e c8d/tag: Don't log a warning if the source image is not dangling
After the image is tagged, the engine attempts to delete a dangling
image of the source image, so the image is no longer dangling.

When the source image is not dangling, the removal errors out (as
expected), but a warning is logged to the daemon log:

```
time="2024-12-02T10:44:25.386957553Z" level=warning msg="unexpected error when deleting dangling image" error="NotFound: image \"moby-dangling@sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045\": not found" imageID="sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045" spanID=bd10a21a07830d72 tag="docker.io/library/test:latest" traceID=4cf61671c2dc6da3dc7a09c0c6ac4e16
```

Remove that log as it causes unnecessary confusion, as the failure is
expected.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit a93f6c61db)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-12-02 11:52:01 +01:00
Sebastiaan van Stijn
5a7a2099b2 Merge pull request #48921 from austinvazquez/cherry-pick-runtime-updates-to-25.0
[25.0 backport] Dockerfile: update containerd v1.7.24, runc v1.2.2
2024-12-01 10:59:03 +01:00
Sebastiaan van Stijn
6f497b2d51 Dockerfile: update to runc v1.2.2
- 1.2.2 release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.2
- 1.2.1 release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.1
- 1.2.0 release notes: https://github.com/opencontainers/runc/releases/tag/v1.2.0

Breaking changes and deprecations are included below;

Breaking changes:

Several aspects of how mount options work has been adjusted in a way that
could theoretically break users that have very strange mount option strings.
This was necessary to fix glaring issues in how mount options were being
treated. The key changes are:

- Mount options on bind-mounts that clear a mount flag are now always
  applied. Previously, if a user requested a bind-mount with only clearing
  options (such as rw,exec,dev) the options would be ignored and the
  original bind-mount options would be set. Unfortunately this also means
  that container configurations which specified only clearing mount options
  will now actually get what they asked for, which could break existing
  containers (though it seems unlikely that a user who requested a specific
  mount option would consider it "broken" to get the mount options they
  asked foruser who requested a specific mount option would consider it
  "broken" to get the mount options they asked for). This also allows us to
  silently add locked mount flags the user did not explicitly request to be
  cleared in rootless mode, allowing for easier use of bind-mounts for
  rootless containers.
- Container configurations using bind-mounts with superblock mount flags
  (i.e. filesystem-specific mount flags, referred to as "data" in
  mount(2), as opposed to VFS generic mount flags like MS_NODEV) will
  now return an error. This is because superblock mount flags will also
  affect the host mount (as the superblock is shared when bind-mounting),
  which is obviously not acceptable. Previously, these flags were silently
  ignored so this change simply tells users that runc cannot fulfil their
  request rather than just ignoring it.

Deprecated

- runc option --criu is now ignored (with a warning), and the option will
  be removed entirely in a future release. Users who need a non-standard
  criu binary should rely on the standard way of looking up binaries in
  $PATH.
- runc kill option -a is now deprecated. Previously, it had to be specified
  to kill a container (with SIGKILL) which does not have its own private PID
  namespace (so that runc would send SIGKILL to all processes). Now, this is
  done automatically.
- github.com/opencontainers/runc/libcontainer/user is now deprecated, please
  use github.com/moby/sys/user instead. It will be removed in a future
  release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e257856116)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 09:23:18 -07:00
Austin Vazquez
01c163d4ee Dockerfile: update containerd to v1.7.24
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
(cherry picked from commit 8cecf3a71c)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 09:23:15 -07:00
Sebastiaan van Stijn
7812180193 Merge pull request #49001 from austinvazquez/cherry-pick-fb6e650ab9dec7f9e8a67b278104881f03f63d08-to-25.0
[25.0 backport] integration: add wait
2024-11-30 09:59:18 +01:00
Sebastiaan van Stijn
cd20907cc5 Merge pull request #49003 from austinvazquez/cherry-pick-ci-updates-to-25.0
[25.0 backport] gha: more limits, update alpine version, and some minor improvements
2024-11-30 09:51:10 +01:00
Sebastiaan van Stijn
708c8dc304 gha: shorter time limits for smoke, validate
- validate-prepare and smoke-prepare took 10 seconds; limiting to 10 minutes
- smoke tests took less than 3 minutes; limiting to 10 minutes
- validate: most took under a minute, but "deprecate-integration-cli" took
  14 minutes; limiting to 30 minutes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a051aba82e)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:59:38 +00:00
Sebastiaan van Stijn
f6bcbab7a1 gha: use "ubuntu-24.04" instead of "ubuntu-latest"
To be more explicit on what we're using.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 91c448bfb5)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:59:27 +00:00
Sebastiaan van Stijn
2de8143fa6 gha: dco: small tweaks to running the container
- add `--quiet` to suppress pull progress output
- use `./` instead of `$(pwd)` now that relative paths are supported
- set the working directory on the container, so that we don't have to `cd`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9a14299540)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:59:18 +00:00
Sebastiaan van Stijn
e0857ef530 gha: dco: update ALPINE_VERSION to 3.20
Alpine 3.16 has been EOL for some time. Update to the latest version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3cb98d759d)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:59:03 +00:00
Sebastiaan van Stijn
1b7b596513 gha: build (binary), build (dynbinary): limit to 20 minutes
Regular runs are under 5 minutes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cfe0d2a131)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:58:53 +00:00
Sebastiaan van Stijn
2e43cd5450 gha: dco: limit to 10 minutes
Regular runs are under a minute.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e75f7aca2f)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:58:43 +00:00
Akihiro Suda
bdb21cd779 integration: add wait
Cherry-picked several WIP commits from
b0a592798f/

Originally-authored-by: Rodrigo Campos <rodrigoca@microsoft.com>
Co-Authored-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fb6e650ab9)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-30 05:23:41 +00:00
Austin Vazquez
cf1608cf12 Merge pull request #48997 from thaJeztah/25.0_backport_modprobe_br_netfilter
[25.0 backport] Jenkinsfile: modprobe br_netfilter
2024-11-29 19:44:49 -08:00
Sebastiaan van Stijn
911478fb28 Jenkinsfile: modprobe br_netfilter
Make sure the module is loaded, as we're not able to load it from within
the dev-container;

    time="2024-11-29T20:40:42Z" level=error msg="Running modprobe br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.15.0-1072-aws\n" error="exit status 1"

Also moving these steps _before_ the "print info" step, so that docker info
doesn't show warnings that bridge-nf-call-iptables and bridge-nf-call-ip6tables
are not loaded.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cce5dfe1e7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-29 23:28:49 +01:00
Austin Vazquez
1bb77b9532 Merge pull request #48928 from thaJeztah/25.0_backport_own-cgroup-path
[25.0 backport] daemon: use OwnCgroupPath in withCgroups
2024-11-22 08:24:21 -08:00
Kir Kolyshkin
2278d180a7 daemon: use OwnCgroupPath in withCgroups
Note: this usage comes from commit 56f77d5ade (part of PR 23430).

cgroups.InitCgroupPath is removed from runc (see [1]), and it is
suggested that users use OwnCgroupPath instead, because using init's is
problematic when in host PID namespace (see [2]) and is generally not
the right thing to do (see [3]).

[1]: https://github.com/opencontainers/runc/commit/fd5debf3
[2]: https://github.com/opencontainers/runc/commit/2b28b3c2
[3]: https://github.com/opencontainers/runc/commit/54e20217

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6be2074aef)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-22 10:44:11 +01:00
Sebastiaan van Stijn
2440ce0527 Merge pull request #48920 from austinvazquez/cherry-pick-1eccc326deec9e39916c227b2684329b7f010bfd-to-25.0
[25.0 backport] vendor: github.com/golang-jwt/jwt/v4@v4.5.1
2024-11-22 10:18:06 +01:00
Austin Vazquez
a6d1d0693f vendor: github.com/golang-jwt/jwt/v4@v4.5.1
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
(cherry picked from commit 1eccc326de)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-21 18:37:27 +00:00
Akihiro Suda
5b6e0e970e Merge pull request #48876 from austinvazquez/cherry-pick-0e4ab47f232391954a4deb8b781cc8cb25d88469-to-25.0
[25.0 backport] update to go1.22.9
2024-11-14 22:30:49 -07:00
Paweł Gronowski
0ed4861f9c update to go1.22.9
- https://github.com/golang/go/issues?q=milestone%3AGo1.22.9+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.22.8...go1.22.9

go1.22.9 (released 2024-11-06) includes fixes to the linker. See the
[Go 1.22.9 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.22.9+label%3ACherryPickApproved)
milestone for details.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 0e4ab47f23)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-14 14:27:27 -07:00
Sebastiaan van Stijn
1c354d1f7a Merge pull request #48803 from austinvazquez/cherry-pick-runc-updates-to-25.0
[25.0 backport] Dockerfile: update runc to v1.1.14
2024-10-31 08:56:37 +01:00
Sebastiaan van Stijn
2df019330c update runc binary to 1.1.14
Update the runc binary that's used in CI and for the static packages.

diff: https://github.com/opencontainers/runc/compare/v1.1.13...v1.1.14

Release Notes:

- Fix CVE-2024-45310, a low-severity attack that allowed maliciously configured containers to create empty files and directories on the host.
- Add support for Go 1.23.
- Revert "allow overriding VERSION value in Makefile" and add EXTRA_VERSION.
- rootfs: consolidate mountpoint creation logic.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2189aa2426)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-30 20:31:09 -07:00
Sebastiaan van Stijn
e6de0b8f3b update runc binary to v1.1.13
Update the runc binary that's used in CI and for the static packages.

full diff: https://github.com/opencontainers/runc/compare/v1.1.12...v1.1.13

Release notes:

* If building with Go 1.22.x, make sure to use 1.22.4 or a later version.

* Support go 1.22.4+.
* runc list: fix race with runc delete.
* Fix set nofile rlimit error.
* libct/cg/fs: fix setting rt_period vs rt_runtime.
* Fix a debug msg for user ns in nsexec.
* script/*: fix gpg usage wrt keyboxd.
* CI fixes and misc backports.
* Fix codespell warnings.

* Silence security false positives from golang/net.
* libcontainer: allow containers to make apps think fips is enabled/disabled for testing.
* allow overriding VERSION value in Makefile.
* Vagrantfile.fedora: bump Fedora to 39.
* ci/cirrus: rm centos stream 8.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9101392309)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-30 20:30:44 -07:00
Sebastiaan van Stijn
b7902b3391 Merge pull request #48787 from austinvazquez/cherry-pick-10d57fde4497fb1e141f2020697528acece38425-to-25.0
[25.0 backport] volume/mounts: fix anonymous volume not being labeled
2024-10-28 22:41:12 +01:00
Sebastiaan van Stijn
cb56070132 volume: VolumesService.Create: fix log-level for debug logs
These log-entries were added in 10d57fde44,
but it looks like I accidentally left them as Error-logs following some
debugging (whoops!).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 352b4ff2f1)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-28 15:22:15 +00:00
Sebastiaan van Stijn
480b01a532 volume/mounts: fix anonymous volume not being labeled
`Parser.ParseMountRaw()` labels anonymous volumes with a `AnonymousLabel` label
(`com.docker.volume.anonymous`) label based on whether a volume has a name
(named volume) or no name (anonymous) (see [1]).

However both `VolumesService.Create()` (see [1]) and `Parser.ParseMountRaw()`
(see [2], [3]) were generating a random name for anonymous volumes. The latter
is called before `VolumesService.Create()` is called, resulting in such volumes
not being labeled as anonymous.

Generating the name was originally done in Create (fc7b904dce),
but duplicated in b3b7eb2723 with the introduction
of the new Mounts field in HostConfig. Duplicating this effort didn't have a
real effect until (`Create` would just skip generating the name), until
618f26ccbc introduced the `AnonymousLabel` in
(v24.0.0, backported to v23.0.0).

Parsing generally should not fill in defaults / generate names, so this patch;

- Removes generating volume names from  `Parser.ParseMountRaw()`
- Adds a debug-log entry to `VolumesService.Create()`
- Touches up some logs to use structured logs for easier correlating logs

With this patch applied:

    docker run --rm --mount=type=volume,target=/toto hello-world

    DEBU[2024-10-24T22:50:36.359990376Z] creating anonymous volume                     volume-name=0cfd63d4df363571e7b3e9c04e37c74054cc16ff1d00d9a005232d83e92eda02
    DEBU[2024-10-24T22:50:36.360069209Z] probing all drivers for volume                volume-name=0cfd63d4df363571e7b3e9c04e37c74054cc16ff1d00d9a005232d83e92eda02
    DEBU[2024-10-24T22:50:36.360341209Z] Registering new volume reference              driver=local volume-name=0cfd63d4df363571e7b3e9c04e37c74054cc16ff1d00d9a005232d83e92eda02

[1]: 032721ff75/volume/service/service.go (L72-L83)
[2]: 032721ff75/volume/mounts/linux_parser.go (L330-L336)
[3]: 032721ff75/volume/mounts/windows_parser.go (L394-L400)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 10d57fde44)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-28 15:21:40 +00:00