Skip to content

docker build quiet -q with output -o specified prints empty line #3424

@jonasbadstuebner

Description

@jonasbadstuebner

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I ran docker build -q -t myimage:local -o output-path/ .

I'm aware that -q explicitly states that it prints the Image ID on success.

Expected behaviour

It should print nothing and just put all files to the output directory.

Actual behaviour

I get an empty line in my output.

Buildx version

github.com/docker/buildx 0.25.0 faaea65

Docker info


Builders list

not relevant

Configuration

I could provide, if necessary - but this is probably not related.

Build logs


Additional info

I know it is a nitpick, but I run this command in a make command and it just looks as if there is something missing. I could sed or awk it away, but this just works around the root cause.

I'm happy to open a PR for this small inconvenience, I just need some input, if the output should be skipped if:

  1. the image id is empty anyway? (could break scripts that check the last line of the output)
  2. only if a special flag is set? (would be explicit, non-breaking and fit my use-case just fine)
  3. only local and tar exports are specified? (is the image id always empty then?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions