Skip to content

[FEATURE] Update console color output to match the new color customization support in buildkit #9818

@spkane

Description

@spkane

Description

buildkit output colors can now be configured (BUILDKIT_COLORS) or completely disabled (NO_COLOR) via environment variables. This has been merged into the currently released versions of buildkit and docker buildx, and will show up in docker build as soon as Docker CLI v22.06.0. ships.

See: moby/buildkit#2954

It would be really nice to implement the same support into this plugin (and other core docker plugins that output to the console).

The current dark blue is tough to read on a dark background.

For buildkit, the env var looks something like this:

BUILDKIT_COLORS=run=green:warning=yellow:error=red:cancel=cyan

It probably makes sense to support a DOCKER_COLORS env var which is read first by a plugin and then can be overridden by a more specific one if that is set (as in the BUILDKIT case).

It is probably worth putting all this logic into a library that all these plugins can use, but that could be done as a later re-factor as well.

This is an example of what the output looks like from docker buildx, when this variable is used:

CleanShot 2022-09-07 at 10 43 30

Additional information you deem important (e.g. issue happens only occasionally):

Having constant and readable output is pretty important when pairing, mobbing, teaching etc, so making this configurable is pretty useful and avoids forcing people to change their terminal colors, just so the output can be read easily.

Output of docker compose version:

Docker Compose version v2.10.2-13-ge7b488bb

Additional environment details:

  • I built the compose plugin from the v2 to make sure there wasn't any unreleased code that addressed this.

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