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

List of build-args and stages should be sorted alphabetically in --call outline and --call targets output #2974

Open
thaJeztah opened this issue Feb 10, 2025 · 2 comments
Labels
kind/enhancement New feature or request status/triage

Comments

@thaJeztah
Copy link
Member

Description

Output of --call outline and --call targets currently prints build-args and stages in the order in which they appear in the Dockerfile. This makes it harder to find specific targets or args in the list for more complex Dockerfiles;

docker build --call outline .
[+] Building 2.5s (9/9) FINISHED                                                                                     docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                 0.0s
 => => transferring dockerfile: 5.15kB                                                                                               0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                            1.1s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                                                     0.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25      0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25                 0.0s
 => [internal] load metadata for docker.io/tonistiigi/xx:1.6.1                                                                       1.2s
 => [internal] load metadata for docker.io/library/golang:1.23.6-alpine3.21                                                          0.7s
 => [auth] tonistiigi/xx:pull token for registry-1.docker.io                                                                         0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                        0.0s
 => [internal] load .dockerignore                                                                                                    0.0s
 => => transferring context: 263B                                                                                                    0.0s
TARGET: binary

BUILD ARG               VALUE    DESCRIPTION
BASE_VARIANT            alpine
ALPINE_VERSION          3.21
GO_VERSION              1.23.6
XX_VERSION              1.6.1
GOVERSIONINFO_VERSION   v1.4.1
GO_LINKMODE             static   defines if static or dynamic binary should be produced
GO_BUILDTAGS                     defines additional build tags
GO_STRIP                         strips debugging symbols if set
CGO_ENABLED                      manually sets if cgo is used
VERSION                          sets the version for the produced binary
PACKAGER_NAME                    sets the company that produced the windows binary
docker build --call targets .
[+] Building 0.8s (3/3) FINISHED                                                                                     docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                 0.0s
 => => transferring dockerfile: 5.15kB                                                                                               0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                            0.6s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25      0.0s
 => => resolve docker.io/docker/dockerfile:1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25                 0.0s
TARGET            DESCRIPTION
xx
build-base-alpine
build-alpine
build-base-debian
build-debian
goversioninfo
gotestsum
build
test
test-coverage
build-plugins
e2e-base-alpine
e2e-base-debian
buildx
compose
e2e
dev
plugins
bin-image-linux
bin-image-darwin
bin-image-windows
bin-image
binary (default)

What I'd like to see

Given that the order in which these appear in the Dockerfile is irrelevant to using them, we should consider sorting them alphabetically, possibly considering the (default) to be printed in a separate column.

@thaJeztah thaJeztah added kind/enhancement New feature or request status/triage labels Feb 10, 2025
@tonistiigi tonistiigi changed the title List of build-args and stages should be sorted alphabetically in --call outline and --tall targets output List of build-args and stages should be sorted alphabetically in --call outline and --call targets output Feb 12, 2025
@tonistiigi
Copy link
Member

Given that the order in which these appear in the Dockerfile is irrelevant to using them,

I'm not sure if it is entirely irrelevant. I'd guess the author of the Dockerfile mostly puts the stages in the order where they make the most sense.

@thaJeztah
Copy link
Member Author

Yeah, possibly in some cases. Then again, I'd expect for the author it would be more likely to have the Dockerfile itself opened in an editor, but outline to give the overview for those who don't.

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