Commit Graph
325 Commits
Author SHA1 Message Date
Tõnis TiigiandGitHub a0a8f63cd5 Merge pull request #3730 from crazy-max/history-mv-buildname
history: move BuildName to util/history
2026-03-19 16:55:45 -07:00
Tõnis TiigiandGitHub 771e0de740 Merge pull request #3732 from tonistiigi/imagetools-manifest-regex
imagetools: use regex for manifest template matching
2026-03-18 18:25:27 -07:00
Tonis Tiigi 78439e263b imagetools: use regex for manifest template matching
Allow optional whitespace inside the {{.Manifest}} template
delimiters when detecting whole-manifest format strings.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-17 17:46:01 -07:00
Tonis Tiigi e4f6e373af imagetools: share ingester across concurrent copies
Reuse a single ingester per target repository when imagetools create
copies multiple manifests in parallel.

This lets the pushing ingester serialize same-digest pushes and avoids
racing duplicate blob uploads against registries to work around bug in
Registry v3.0.0 (and possibly others).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-17 17:18:55 -07:00
CrazyMax b272a37d46 history: move BuildName to util/history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 23:49:53 +01:00
CrazyMax c4e9dfcad9 bundle: use all node content stores during export
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 11:08:18 +01:00
Tonis Tiigi 863398c789 imagetools: pass referrer filter opts to oci-layout path
FetchReferrers accepted FetchReferrersOpt but dropped them
when resolving OCI layout referrers. Forward the options and
apply ArtifactTypes filtering so callers can narrow results
consistently for both registry and local layout sources.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 23:15:01 -07:00
Tonis Tiigi 6eb48d9c8c imagetools: fix oci-layout index update when blob exists
When pushing to an OCI layout where the top-level descriptor
blob already existed, pushOCILayout returned early without
updating index.json or writing pending referrers. Restructure
the control flow so the blob-exists case skips only the write
but still updates the index and flushes referrers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:54:35 -07:00
Tonis Tiigi 3e5c05cb1f imagetools: support oci-layout referrers
Handle OCI layout referrers via subject-annotated index entries and add
integration coverage for copying signed attestations through oci-layout.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:45:01 -07:00
Tonis Tiigi 9894189361 imagetools: support oci-layout refs
Add oci-layout:// source and target support to imagetools create and
inspect while keeping merge, filter, and referrer logic shared.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:45:01 -07:00
CrazyMax 2ed4ece865 build: reuse build session for policy source resolution
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-04 17:21:20 +01:00
Tonis Tiigi 4880756a0f policy: simplify recursive material resolution
Unify root/material unknown resolution with recursive Input traversal.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 09:14:25 -08:00
Tonis Tiigi b62fc30524 build: resolve policy files from context state and unified FS
Support remote context policy files via resolved context state and cwd:// override.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-23 16:22:19 -08:00
Tonis Tiigi 10c5f00efa sourcemeta: unblock concurrent resolver open waiters
Prevent concurrent ResolveSourceMetadata calls from hanging while
waiting for resolver initialization.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-20 08:56:41 -08:00
Tonis Tiigi 5c3551beeb policy: add GitHub attestation verification
Add github_attestation and github_release_attestation policy support.
Fetch GitHub attestation bundles (including bundle_url .json.sn decode)
and verify against input.http.checksum.

Wire source metadata resolver progress through resolver options and add
ResolveState support for policy HTTP attestation fetches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-20 08:56:40 -08:00
Tonis Tiigi dce5289722 policy: separate sourcemetaresolver utility to reusable pkg
Turn the current utility used by policy helper commands that
allows getting gateway.Client lazily into reusable package.

This is preparation for using this utility also in the policy
verification, outside of commands.

Only expose SourceMetaResolver as other methods of gateway client
are not needed atm by any callers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-13 13:59:33 -08:00
CrazyMaxandGitHub 53882aec96 Merge pull request #3649 from tonistiigi/update-buildkit-dev
vendor: update buildkit to v0.28-dev-9836771d0c5b
2026-02-12 10:06:45 +01:00
Tonis Tiigi a5b712b275 confutil: fix toml rewriting in new package
Seems marshalling the typed struct causes empty fields
e.g. gcpolicy = [] that (old versions of?) BuildKit do no allow.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-11 21:47:11 -08:00
CrazyMax 7899695fa6 history: don't import build package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-11 10:29:47 +01:00
Tonis Tiigi 9d803b0d87 vendor: update buildkit to v0.28-dev-9836771d0c5b
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-10 11:59:30 -08:00
Tõnis TiigiandGitHub 32e47355af Merge pull request #3627 from tonistiigi/imagetools-auth
imagetools: use dockerconfig for auth
2026-02-03 13:14:33 -05:00
Tonis Tiigi 87c77aca7b imagetools: avoid trying to load attestations inline references
When creating resulting image index it is wasteful
to check for attestations for the descriptors in original
index what were already attestation for subject manifest.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-28 08:28:29 -08:00
Tonis Tiigi 27dde04ab5 imagetools: use dockerconfig for auth
Enables fallback for DHI and Scout registries and
repo/scope specific credentials like supported for builds.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-26 10:15:14 -08:00
Tonis Tiigi e254cf1985 auth: create new authorizer for imagetools
Based on containerd Authorizer.

Removed unused RefreshToken, fixed error handling.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-26 10:14:21 -08:00
Tonis Tiigi f764c6f025 dockerconfig: add fallback for loading DHI and Scout credentials
These are also Docker managed registries with same users.

Fall back to main hostname if not logged in to exact domain.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 12:45:05 -08:00
Tonis Tiigi 9f1daffb32 policy: implement policy support for bake
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:23 -08:00
Tonis Tiigi c5154b3169 update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-09 18:54:15 -08:00
Tõnis Tiigi 37e283ceb0 auth: add option to load docker config for specific repo/scope
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-07 11:45:04 -08:00
Jonathan A. Sternberg fdfba3014d tests: add integration tests for dap build
This adds integration tests for the `dap build` command to test various
behavior associated with the command. We start the build and the
integration test acts as a dap client to send requests and check that
the output is what we expect.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-12-17 10:56:30 -06:00
Sebastiaan van Stijn 18dc2e088a vendor: github.com/moby/moby/api v1.52.0, moby/client v0.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 01:30:02 +01:00
Tonis Tiigi 79b6474639 imagetools: add sigstore bundle v3 to supported referrer formats
This was added after the initial version was written.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-05 14:00:05 -08:00
Tonis Tiigi e13cd5c9df imagetools: support for creating attestations/signatures
Persist attestation manifest and any manifest cosign-based
signatures when creating new images.

When creating index from single-arch manifests where attestation
manifest is not inlined, it can be loaded from referrers API.
Note that for this to work the attestation manifest needs to be
in artifact type when image was built.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit aab8171f824d13d703e869107e1720ad71d24bff)
2025-11-05 12:59:27 -08:00
CrazyMax 7652057da2 docker-container: write github actions payload to container for provenance
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-24 10:52:49 +02:00
Tonis Tiigi ba4935585c imagetools: silence warning for empty-type meditype used in artifacts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-10-02 10:43:33 -07:00
CrazyMax 7eefa86662 test: use temp dir for TestGit
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-29 10:54:39 +02:00
Tonis Tiigi f448f3e22b imagetools: add platforms filter to imagetools create
Allows specifying platforms that should be included
in the new image, making it possible to reduce platforms
of existing multi-arch image. Previously the individual
image manifests needed to be used as sources, but that
dropped their related attestation manifests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-23 08:10:11 -07:00
Tonis Tiigi 4ad48f7737 imagetools: variables name refactor
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-22 09:25:48 -07:00
CrazyMax 0beb1b3f2b lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 22:07:37 +02:00
Tõnis TiigiandGitHub 9a07004534 Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2025-07-10 08:30:29 -07:00
CrazyMaxandGitHub a007368729 Merge pull request #3291 from crazy-max/chore-rm-comment
otelutil: remove unrelated comment
2025-07-03 14:33:49 +02:00
CrazyMax 84e03159a6 otelutil: remove unrelated comment
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-03 13:50:50 +02:00
Sebastiaan van Stijn 1205802f63 util/otelutil: change uses of deprecated instrumentation.Library
While the interface's signature uses the deprecated "Library" type,
and upstream documents it as "needed for backward compatibility";
https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/trace/span.go#L62-L65

The Library type is now an alias for Scope, so using the non-deprecated
type still satisfies the interface;
https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/instrumentation/library.go#L6-L9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-03 13:40:29 +02:00
Tõnis TiigiandGitHub 758ea75f60 Merge pull request #3235 from jsternberg/dap-handler
dap: add debug adapter implementation
2025-07-02 12:58:07 -07:00
CrazyMax a711b8ff88 cmd: fix possible skipped defers for build and bake
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-01 09:45:27 +02:00
Jonathan A. Sternberg 42599a7d49 dap: add debug adapter implementation
Adds a simple implementation of the debug adapter that supports the very
basics of a debug adapter.

It supports the launch request, the configuration done request, the
creation of threads, stopping, resuming, and disconnecting from server.

It does not support custom breakpoints, stack traces, or variable
inspection yet. These are planned to be added in the future.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-30 10:51:20 -05:00
Jonathan A. Sternberg 7660acf9c7 progress: ensure bake waits for progress to finish printing on error conditions
Some minor fixes to the printer and how bake invokes it. Bake previously
had a race condition that could result in the display not updating on an
error condition, but it was much rarer because the channel communication
was much closer. The refactor added a proxy for the status channel so
there was more of an opportunity to surface the race condition.

When bake exits with an error when reading the bakefiles, it doesn't
wait for the printer to finish so it is possible for the printer to
update the display after an error is printed. This adds an extra `Wait`
in a defer to make sure the printer is finished.

`Wait` has also been fixed to allow it to be called multiple times and
have the same behavior. Previously, it only waited for the done channel
once so only the first wait would block.

The `onclose` method is now called every time the display is paused or
stopped. That was the previous behavior and it's been restored here.

The display only gets refreshed if we aren't exiting. There's no point
in initializing another display if we're about to exit.

The metric writer attached to the printer was erroneously removed. It is
now assigned properly.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-16 12:24:04 -05:00
Jonathan A. Sternberg e1adeee898 vendor: github.com/moby/buildkit v0.23.0-rc1
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-11 16:29:31 -05:00
Tonis Tiigi da426ecd3a imagetools: support registrytoken auth in docker config
This is not supported by the Authorizer from containerd and
needs to be added manually. Build authentication happens through
BuildKit session that already supports this.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-06-10 23:20:08 -07:00
Tonis Tiigi 10618d4c73 imagetools: move auth function to separate file
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-06-10 22:04:56 -07:00
Jonathan A. Sternberg 34e59ca1bd progress: fix progress writer pause and unpause to prevent panics
This changes the progress printer's pause and unpause implementation to
be reentrant to prevent race conditions and it also allows the status
updates to be buffered when the display is paused.

The previous implementation mixed the pause implementation with the
finish implementation and could cause a send on closed channel panic
because it could close the status channel before it had finished being
used. Now, the status channel is not closed.

When the display is enabled, the status channel will be forwarded to an
internal channel that is used to display the updates. When the display
is paused, the status channel will have the statuses buffered in memory
to be sent when the progress display is resumed.

The `Unpause` method has also been renamed to `Resume`.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-09 14:07:52 -05:00