Addresses https://github.com/docker/setup-buildx-action/issues/45
Simple repro:
```
$ buildx create --platform linux/amd64 --use
$ buildx build - <<EOF
from scratch
EOF
```
Since https://github.com/docker/buildx/pull/370 a `platform` driver-opt was automatically inserted with the value specified by `--platform` flag on regardless of the type of driver, even though it was only used in the kubernetes driver. However, because the docker-container driver is pedantic about the options being passed, it errored out.
Another side-effect I suspect is that with the kubernetes driver it was now possible to specify the platforms in two different ways: `--driver-opt platform=...` and `--platform`.
This patch reverts completely the `platform` driver-opt and instead ensures the platforms information is passed onto the kubernetes driver via variables.
Signed-off-by: Tibor Vass <tibor@docker.com>
These annotations were picked up by the YAML docs generator, and shows up as
"minimum API version". I couldn't find a reference to these annotations in the
PR that added them, so thought it would be ok to remove
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The docker builder prune command has a shorthand `-f` flag for `--force`:
docker builder prune --help
Usage: docker builder prune
Remove build cache
Options:
-a, --all Remove all unused build cache, not just dangling ones
--filter filter Provide filter values (e.g. 'until=24h')
-f, --force Do not prompt for confirmation
--keep-storage bytes Amount of disk space to keep for cache
Given that `buildx` can be used as a drop-in replacement for the native build
commands, it should match the UI, and also have a shorthand flag.
This patch also updates the flag's description to be in line with the docker commandline
With this patch applied;
buildx prune --help
Remove build cache
Usage:
buildx prune [flags]
Flags:
-a, --all Remove all unused images, not just dangling ones
--filter filter Provide filter values (e.g. 'until=24h')
-f, --force Do not prompt for confirmation
-h, --help help for prune
--keep-storage bytes Amount of disk space to keep for cache
--verbose Provide a more verbose output
Global Flags:
--builder string Override the configured builder instance
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This allows all subcommands to use this flag.
Additionally reads the default value for the flag from the
`BUILDX_BUILDER` env var.
Precedence is:
CLI ARG > flag > env var > config file
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Although bake is for running multiple targets, --set required a single
target name for overriding a property. This change allows matching
multiple targets for overrides.
Signed-off-by: Tibor Vass <tibor@docker.com>