skip to Main Content

Many Docker commands show something that in the lack of a better word I’d call a "pseudo-GUI" on the console, like for example Docker build. This GUI is staying at the same position on the console and updating live:

enter image description here

I’d rather like to have a simple stream of output, like it is written by most console applications. Means no control characters, no colors, just writing line after line.

Is there a command option to do so on the Docker CLI?

2

Answers


  1. That’s the default behavior of buildkit. To achieve the desired output, use --progress=plain when building the image:

    $ docker build --progress-plain ...
    

    or you can disable BUILDKIT altogether for the build:

    $ DOCKER_BUILDKIT=0 docker build ...
    
    Login or Signup to reply.
  2. The change in output format happened because BuildKit is now the default builder in Docker (as of version 23.0).

    You can add --progress=plain to your docker command to have the output stream in a simpler format.

    If you want to set that as the default, you can set the BUILDKIT_PROGRESS environment variable to plain in your shell startup file.

    You can opt out of using BuildKit by setting the environment variable DOCKER_BUILDKIT to 0. Then it’ll use the legacy builder and the output will look like you’re used to. I won’t recommend this though and the legacy builder will likely be removed in a future version of Docker.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search