Track fields reloaded during eval --print resolution loops and filter
final invalid-field warnings against that set.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
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>
Make the code more unified between validation and
test command. Normalize to key without the input prefix.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Add metrics associated with the debugger that are reported through the
metrics writer. This adds a few attributes that are only added when a
debugger is used with either the `debug` command or `dap` command.
At the moment, these metrics show up the exact same as a build and we
can't identify if something is using `dap` or `debug` since they use the
same code path.
This also adds a new available metric that can be utilized by plugins to
report additional information. The metrics will check if an environment
variable `BUILDX_DAP_USER_AGENT` is sent and that will get included in
the metrics if they are enabled.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
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>
Currently needed manifests were filtered out and then
copied in a loop, but for each copy still the full
unfiltered descriptor was copied instead of single
manifest, resulting multiple push attempts for same
descriptor.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
- Make sure tag is added to image reference as
containerd reference parser refuses to parse otherwise.
- When attestation is asked from non-index, return
nil instead of error. This is for consistency as likely
to fail in BuildKit before that is fixed separately.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This provides alternative way to set values for Bake
variables without adding them the global environment variables.
This can also be used then environment variable access
is disabled with BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Automatically set `unpack=false` for registry exports unless explicitly
overridden by the user.
This applies to:
- `registry` exporter type (converted to `image` exporter with `push=true`)
- `--push` flag usage with image exporters
Users can still explicitly set `unpack=true` if they need local image
storage alongside registry push.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
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>
The -D/--debug flag was not enabling debug logging in standalone mode.
Root cause: debug.Enable() was called before dockerCli.Initialize(),
but Initialize() calls SetLogLevel("") which resets logrus level to
Info, and since options.Debug was false, it wasn't re-enabled.
Fix: Pass opt.debug to options.Debug before Initialize() so it
properly enables debug level after SetLogLevel().
Signed-off-by: Sergei Khomenkov <sergey@homenkow.ru>
Workaround for containerd issue that can cause concurrent map
write when WithMediaTypeKeyPrefix is called in parallel
goroutines for context that originated from same base context.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
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)
Deprecate these commands in favor of using `docker buildx` directly,
without relying on the `docker builder` alias.
The commands have been hidden since the beginning.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
When creating index from singe-arch manifests it
was possible for some of the internal manifests to not
be copies and cause error on pushing the index.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
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>