I am using 'docker build' on Windows 10 to build asp net core web app image. However, since the last update, messages are colored in such a way that it gets unreadable. Searching on the internet did not provide any answers.
Any ideas on how to get around this?
[Updated 2022-08-02]
As of PR #2954 (which may take a bit to get released into Docker Desktop), you can run:
export NO_COLOR=1
There have also been changes to make the default text colors more readable.
[Original answer]
With docker, you can pass the --help
option to a command to see usage. E.g.:
$ docker build --help
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
--build-arg list Set build-time variables
--cache-from strings Images to consider as cache sources
--disable-content-trust Skip image verification (default true)
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
--iidfile string Write the image ID to the file
--isolation string Container isolation technology
--label list Set metadata for an image
--network string Set the networking mode for the RUN instructions during build (default "default")
--no-cache Do not use cache when building the image
-o, --output stringArray Output destination (format: type=local,dest=path)
--platform string Set platform if server is multi-platform capable
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
--pull Always attempt to pull a newer version of the image
-q, --quiet Suppress the build output and print image ID on success
--secret stringArray Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
--squash Squash newly built layers into a single new layer
--ssh stringArray SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
-t, --tag list Name and optionally a tag in the 'name:tag' format
--target string Set the target build stage to build.
For turning off the colored output, you can set --progress plain
which removes the color formatted text and other tty features like updating the time for each build step. You can make this the default with:
export BUILDKIT_PROGRESS=plain
Alternatively, you may just want to change the color of your terminal. Black and white both work nicely. But a bluish background will clash with the blue text.
The other option is to disable buildkit and revert back to the classic build engine. That can be done with an environment variable:
export DOCKER_BUILDKIT=0
or configuring the default in /etc/docker/daemon.json
:
{
"features": {"buildkit": false }
}
However, the classic builder will not support features being added to buildkit and is unlikely to see much development going forward.
Just add flag --progress plain
while running docker build
command, in the last.
for example,
docker build -t getting-started . --progress plain
Another ev option
export BUILDKIT_PROGRESS=plain
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With