Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add build --compression flag #3072

Open
vvoland opened this issue Mar 19, 2025 · 1 comment
Open

Proposal: Add build --compression flag #3072

vvoland opened this issue Mar 19, 2025 · 1 comment
Labels
kind/enhancement New feature or request status/triage

Comments

@vvoland
Copy link
Contributor

vvoland commented Mar 19, 2025

Description

Add --compression flag as a shorthand for: -o type=image,compression=<X>

Examples

-docker build -t asdf -o type=image,compression=zstd
+docker build -t asdf --compression zstd
-docker build -t asdf -o type=image,compression=uncompressed
+docker build -t asdf --compression uncompressed

Further enhancements

Also supportcompression-level

-docker build -t asdf -o type=image,compression=zstd,compression-level=1
+docker build -t asdf --compression zstd:1

Shorthand for uncompressed value

Optionally, provide none/false value as a shorthand for uncompressed:

-docker build -t asdf -o type=image,compression=uncompressed
+docker build -t asdf --compression none

Short flag

-c/--compressed

-docker build -t asdf -o type=image,compression=uncompressed
+docker build -t asdf -c none
@vvoland vvoland added kind/enhancement New feature or request status/triage labels Mar 19, 2025
@vvoland vvoland changed the title --compression flag build --compression flag Mar 19, 2025
@vvoland vvoland changed the title build --compression flag Proposal: Add build --compression flag Mar 20, 2025
@tonistiigi
Copy link
Member

tonistiigi commented Mar 21, 2025

Note that -o is an array of outputs

Edit: Reading again it looks like you are suggesting not modifying -o but inserting. In that case, outputs like oci, docker also create images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request status/triage
Projects
None yet
Development

No branches or pull requests

2 participants