Skip to content

Allow default for --output flag.#2922

Closed
sudiptob2 wants to merge 1 commit intodocker:masterfrom
sudiptob2:feat/default-config
Closed

Allow default for --output flag.#2922
sudiptob2 wants to merge 1 commit intodocker:masterfrom
sudiptob2:feat/default-config

Conversation

@sudiptob2
Copy link
Copy Markdown

zstd compression is quite popular compared to the default gzip. But to use zstd, we need to pass several parameters. For example:

docker buildx build --output type=image,oci-mediatypes=true,compression=zstd,push=true,force-compression=true --provenance=false .

We can use Bash aliases or scripts to make this easier, but it would be simpler if buildx allowed setting defaults for --output flag.

A possible implementation has been added to this PR.

Signed-off-by: sudipto baral <sudiptobaral.me@gmail.com>
@polarathene
Copy link
Copy Markdown

polarathene commented Mar 5, 2025

--provenance=false

This is due to wanting to avoid the docker-specific additions to the index manifest right? It should be avoidable with BuildKit's oci-artifact=true AFAIK.

That said upstream has also discussed intent to switch to both OCI settings as default in future, which would simplify this a bit further for you.


Related --compression option.

kingj120286-cpu

This comment was marked as spam.

@jsternberg
Copy link
Copy Markdown
Collaborator

I don't think this is a good solution for adding default options. I think bake provides a much more compelling way to wrap more complex build outputs with options and is preferred over an environment variable. I'm going to close this for the moment.

It might make sense to have an environment variable or other way to configure default compression options as I can imagine that being something you might want to change locally to potentially speed up build times by lowering the compression. I'm not really open to the idea of having a default output be controlled by an environment variable though.

@jsternberg jsternberg closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants