37 Commits

Author SHA1 Message Date
Paweł Gronowski
cdce8f4f92 modernize: Use maps.Copy instead of for loops
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Paweł Gronowski
a25907b485 modernize: Prefer strings.SplitSeq instead of Split
Avoids extra allocations. Added in Go 1.24.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-12-15 18:56:33 +01:00
Paweł Gronowski
b4f9bd1cb3 c8d/builder-next: Don't force unpack
The image exporter wrapper was unconditionally setting `unpack=true` for
all build exports, preventing users from controlling this behavior
through buildkit's output image exporter option.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-12 14:34:12 +01:00
Tonis Tiigi
3874ca5984 vendor: update buildkit to v0.26.0-rc2
Currently requires replace rule for swarmkit etcd.

BuildKit itself doesn't use etcd but version gets bumped
via unused dependency.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-11 23:15:07 +01:00
Vigilans
d192a63467 daemon: Ensure buildkit created container's isolation mode consistent with daemon's config
- Introduced DefaultIsolation method in the Daemon to return the daemon configured isolation mode for Windows.

Signed-off-by: Vigilans <vigilans@foxmail.com>
2025-11-10 16:33:14 +01:00
Sebastiaan van Stijn
46090e88e4 daemon/internal/builder-next: Builder.DiskUsage(): use singleflight
Use a singleflight for collecting the build-cache usage; collecting this
information is potentially heavy-weight, and we already do this for the
other disk-usage methods.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 21:32:23 +01:00
Sebastiaan van Stijn
0dcb1fe344 daemon: align build.DiskUsage() with other disk-usages
Move calculation of the data to the builder backend, to align with
the other type of objects. This also allows us to skip the verbose
data if it's not used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:30 +01:00
Sebastiaan van Stijn
0029924181 api/types/system: change legacyDiskUsage to a non-pointer slice
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-06 12:31:05 +01:00
Cory Snider
ae28867804 api/pkg/progress: move to client and daemon/internal
Move the progress package up into the client as a temporary shared location for
common clients like CLI and compose.

The progress package is used by the daemon to write progress updates to
some sink, typically a streamformatter. This package is of little use to
API clients as this package does not provide any facilities to consume
the progress updates.

Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-24 07:56:57 -05:00
Cory Snider
6baf274fa3 api/pkg/streamformatter: move to client and daemon/internal
Move the streamformatter package up into the client for a temporary
shared location between common clients like CLI and compose.

The streamformatter package is used by the daemon to write streams of
status and progress messages to API clients. It is completely out of
scope of the api module and not used outside the daemon. Remove the
unused rawSteamFormatter, whose purpose is to render the progress as a
TUI.

Co-authored-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-10-24 07:56:51 -05:00
Sebastiaan van Stijn
47fe719b33 api/types/build: remove deprecated BuildCache.Parent field
The BuildCache.Parent field was removed in API v1.42 in [moby@e0db820].
While we had to keep the Go struct field around to backfill the field for
older API versions, it's no longer part of API v1.42 and up (using the
"omitempty" is just an implementation detail).

Older clients unconditionally use the `Parents` field if set, and usage
of this field is very limited, so let's remove the field without back-
filling, and have clients use the replacement field;
https://github.com/docker/cli/blob/v28.5.1/cli/command/formatter/buildcache.go

[moby@e0db820]: e0db8207f3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-14 14:51:31 +02:00
Cory Snider
778e5bfad3 api/types/filters: move to daemon/internal
Most of the code in the filters package relates to the unmarshaling,
validation and application of filters from client requests. None of this
is necessary or particularly useful for Go SDK users. Move the full-fat
filters package into daemon/internal and switch all the daemon code to
import that package so we are free to iterate upon the code without
worrying about source-code interface compatibility.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-08 12:06:26 -04:00
Jonathan A. Sternberg
1a7d7cc015 builder: use proper percentage calculations for default gc policy
The default gc policy calculations based on percentage were calculated
improperly. These were calculated correctly in buildkit, but the
calculation method was not copied over correctly when updating the
values.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-10-07 10:18:17 -05:00
Sebastiaan van Stijn
5232d82c1b daemon/server/backend: move build options to buildbackend
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-05 15:56:56 +02:00
Austin Vazquez
26e335b647 api/types/build: move CachePruneOptions to client mod
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-04 16:33:57 -05:00
Austin Vazquez
812aa46d81 Move the api/types/time package to internal daemon package
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-14 07:56:59 -05:00
Matthieu MOREL
96f8c6395e chore: enable use-any rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 17:07:07 +02:00
Sebastiaan van Stijn
c145229828 update some fixtures in tests
updated TestModuleVersion fixture (looks like the test doesn't really care :D)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 20:54:36 +02:00
Sebastiaan van Stijn
37d0204d7f Merge pull request #50594 from thaJeztah/cleanup_v1_handling
builder-next: puller.Snapshot: cleanup handling of v1 images
2025-08-05 19:51:24 +02:00
Sebastiaan van Stijn
5365f08ae2 daemon/config: make DNSConfig.DNS a netip.Addr
Modernize the field and allow using it as-is in some places, or
convert it to a string (which won't produce an error down the line).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 18:48:10 +02:00
Sebastiaan van Stijn
03991f4846 builder-next: puller.Snapshot: cleanup handling of v1 images
- Remove redundant if/else
- Move vars closer to where used now that we don't have the if/else.
- Touch-up error-message to remove engine version and update doc link to DeprecatedSchema1ImageError.
- Touch-up TODOs and add reference to help trace back what's meant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 14:50:26 +02:00
Sebastiaan van Stijn
cf15d5bbc6 remove obsolete //go:build tags
These are no longer needed as these are now part of a module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-01 00:49:22 +02:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Derek McGowan
d00ecdc479 Move pkg/streamformatter to api/pkg/streamformatter
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-30 14:22:31 +02:00
Derek McGowan
66862e14d1 Move pkg/progress to api/pkg/progress
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-30 14:22:31 +02:00
Sebastiaan van Stijn
83510a26b3 api/types: move backend types to daemon/server
The "backend" types in API were designed to decouple the API server
implementation from the daemon, or other parts of the code that
back the API server. This would allow the daemon to evolve (e.g.
functionality moved to different subsystems) without that impacting
the API server's implementation.

Now that the API server is no longer part of the API package (module),
there is no benefit to having it in the API module. The API server
may evolve (and require changes in the backend), which has no direct
relation with the API module (types, responses); the backend definition
is, however, coupled to the API server implementation.

It's worth noting that, while "technically" possible to use the API
server package, and implement an alternative backend implementation,
this has never been a prime objective. The backend definition was
never considered "stable", and we don't expect external users to
(attempt) to use it as such.

This patch moves the backend types to the daemon/server package,
so that they can evolve with the daemon and API server implementation
without that impacting the API module (which we intend to be stable,
following SemVer).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 00:03:04 +02:00
Sebastiaan van Stijn
ca1c5ee08f pkg/stringid: move to daemon, and provide copy in client
The stringid package is used in many places; while it's trivial
to implement a similar utility, let's just provide it as a utility
package in the client, removing the daemon-specific logic.

For integration tests, I opted to use the implementation in the
client, as those should not ideally not make assumptions about
the daemon implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 13:39:32 +02:00
Derek McGowan
f1f83dae55 Move reference to daemon/internal/refstore
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:11:35 -07:00
Derek McGowan
f24455c90b Move image to daemon/internal/image
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:11:02 -07:00
Derek McGowan
1ff6011e04 Move distribution to daemon/internal/distribution
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:10:46 -07:00
Derek McGowan
fa9a3c383d Move layer to daemon/internal/layer
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:10:30 -07:00
Paweł Gronowski
665eb3aa88 Merge pull request #50386 from crazy-max/build-device-entitlement
build: device entitlement support
2025-07-24 15:57:52 +02:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
CrazyMax
d95dceb3b1 build: device entitlement support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-21 10:26:14 +02:00
Derek McGowan
b83f36877f Move internal/mod to daemon/internal/builder-next/worker/mod
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-16 15:06:31 -07:00
Derek McGowan
7d48302134 Move builder to daemon/builder
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-16 15:06:00 -07:00
Derek McGowan
6ff9bea6a7 Move builder/builder-next to daemon/internal/builder-next
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-16 15:05:44 -07:00