docker / docker/buildx

Proposal: Add build `--compression` flag

Open
#3,072 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement status/triage
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the build command's existing handling for the -o type=image output options and how CLI flags are tested. Define which requested forms are in scope, then verify that the selected --compression value produces the equivalent output option and that the documented examples are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.