Skip to content

daemon: stop propagating Image.DockerVersion, Plugin.Config.DockerVersion fields#51101

Merged
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:less_dockerversion
Oct 7, 2025
Merged

daemon: stop propagating Image.DockerVersion, Plugin.Config.DockerVersion fields#51101
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:less_dockerversion

Conversation

@thaJeztah
Copy link
Member

The DockerVersion field was used by the legacy builder, and set when importing an image; when importing an image, this would potentially result in less reproducible images, as the docker version used to import the image would be encoded in the image's "v1" fields.

For the legacy builder, including the version of docker used to build the image could still be useful information (but could be set as comment, similar to what BuildKit does), however, many code paths were also shared with other parts of the code; e.g., when listing images or inspecting images, the DockerVersion field would always be set to the current version of the docker daemon, and not taken from the information available in the image (if any).

This patch removes locations where the DockerVersion field was set to the current version of the daemon binary. When inspecting an image, the field is still set with the information in the image itself (which may be empty in most cases).

This also reduces the number of places where the dockerversion package is used, which still needs a new home.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Oct 5, 2025
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Oct 5, 2025
@thaJeztah thaJeztah marked this pull request as ready for review October 6, 2025 09:50
@thaJeztah thaJeztah marked this pull request as draft October 6, 2025 10:36
@thaJeztah thaJeztah changed the title daemon: stop propagating Image.DockerVersion field daemon: stop propagating Image.DockerVersion, Plugin.Config.DockerVersion fields Oct 6, 2025
@thaJeztah thaJeztah force-pushed the less_dockerversion branch 2 times, most recently from 06e85ce to 6d22fc3 Compare October 6, 2025 20:40
@thaJeztah thaJeztah marked this pull request as ready for review October 6, 2025 20:40
The DockerVersion field was used by the legacy builder, and set when
importing an image; when importing an image, this would potentially
result in less reproducible images, as the docker version used to import
the image would be encoded in the image's "v1" fields.

For the legacy builder, including the version of docker used to build
the image could still be useful information (but could be set as comment,
similar to what BuildKit does), however, many code paths were also shared
with other parts of the code; e.g., when listing images or inspecting images,
the `DockerVersion` field would always be set to the current version of
the docker daemon, and not taken from the information available in the
image (if any).

This patch removes locations where the `DockerVersion` field was set to
the current version of the daemon binary. When inspecting an image, the
field is still set with the information in the image itself (which may
be empty in most cases).

This also reduces the number of places where the `dockerversion` package
is used, which still needs a new home.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

Rebased, to see if we can get around the build-cache issue 😞

@thaJeztah
Copy link
Member Author

Nope; still borked; @vvoland looks like we may need to purge the cache to unblock CI 😞 (Or was downgrading buildkit the solution?)

@thaJeztah
Copy link
Member Author

Hm... running out of disk space on this test; don't think it's related, but ... interesting

=== RUN   TestBuildWithHugeFile
    build_test.go:515: assertion failed: string "{\"stream\":\"Step 1/2 : FROM busybox\"}\r\n{\"stream\":\"\\n\"}\r\n{\"stream\":\" ---\\u003e 1c35c4412082\\n\"}\r\n{\"stream\":\"Step 2/2 : RUN for g in $(seq 0 8); do dd if=/dev/urandom of=rnd bs=1K count=1 seek=$((1024*1024*g)) status=none; done  \\u0026\\u0026 ls -la rnd \\u0026\\u0026 du -sk rnd\"}\r\n{\"stream\":\"\\n\"}\r\n{\"stream\":\" ---\\u003e Running in 497360a59c04\\n\"}\r\n{\"stream\":\"-rw-r--r--    1 root     root     8589935616 Oct  7 08:16 rnd\\n\"}\r\n{\"stream\":\"36\\trnd\\n\"}\r\n{\"stream\":\" ---\\u003e Removed intermediate container 497360a59c04\\n\"}\r\n{\"errorDetail\":{\"message\":\"write /rnd: no space left on device\"},\"error\":\"write /rnd: no space left on device\"}\r\n" does not contain "Successfully built"
--- FAIL: TestBuildWithHugeFile (36.18s)
=== RUN   TestBuildWithHugeFile
    build_test.go:515: assertion failed: string "{\"stream\":\"Step 1/2 : FROM busybox\"}\r\n{\"stream\":\"\\n\"}\r\n{\"stream\":\" ---\\u003e 328dac05c07e\\n\"}\r\n{\"stream\":\"Step 2/2 : RUN for g in $(seq 0 8); do dd if=/dev/urandom of=rnd bs=1K count=1 seek=$((1024*1024*g)) status=none; done  \\u0026\\u0026 ls -la rnd \\u0026\\u0026 du -sk rnd\"}\r\n{\"stream\":\"\\n\"}\r\n{\"stream\":\" ---\\u003e Running in 4951314f29f1\\n\"}\r\n{\"stream\":\"-rw-r--r--    1 root     root     8589935616 Oct  7 08:16 rnd\\n\"}\r\n{\"stream\":\"36\\trnd\\n\"}\r\n{\"stream\":\" ---\\u003e Removed intermediate container 4951314f29f1\\n\"}\r\n{\"errorDetail\":{\"message\":\"failed to apply diff: write /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs/snapshots/191/fs/rnd: no space left on device\"},\"error\":\"failed to apply diff: write /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs/snapshots/191/fs/rnd: no space left on device\"}\r\n" does not contain "Successfully built"
--- FAIL: TestBuildWithHugeFile (62.34s)

@thaJeztah
Copy link
Member Author

Hm... failing again, but the follow-up stacked on this doesn't;

Let me try a rebase to get a fresh run 🤔

The DockerVersion field was present for informational purposes, but was
not used anywhere. This patch stops propagating the field, which also
reduces the number of places where the `dockerversion` package is used,
which still needs a new home.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

This one is really flaky at times;

=== Failed
=== FAIL: daemon/logger/fluentd TestReadWriteTimeoutsAreEffective (10.01s)
    fluentd_test.go:315: Test timed out, which is unexpected
--- PASS: TestReadWriteTimeoutsAreEffective/write_timeout (0.01s)
--- PASS: TestReadWriteTimeoutsAreEffective/read_timeout (10.00s)

@thaJeztah thaJeztah added the release-blocker PRs we want to block a release on label Oct 7, 2025
@thaJeztah
Copy link
Member Author

Green!

@thaJeztah thaJeztah merged commit 8d4cb6e into moby:master Oct 7, 2025
253 of 256 checks passed
@thaJeztah thaJeztah deleted the less_dockerversion branch October 7, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants