Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see all output when executing `docker build`

Tags:

bash

docker

The docker build is scrolling the output.

docker build -t "setuppython"  .

In the screenshot the area enclosed in the red rectangle is being scrolled - and the prior output is lost. I would like to be able to see all output without it being hidden:

enter image description here

Here is the Dockerfile

from ubuntu:20.04
WORKDIR .
RUN echo "HOME is $HOME"
COPY  ./setup-python.sh .

RUN ./setup-python.sh

How can that be done?

like image 933
WestCoastProjects Avatar asked Jan 24 '26 06:01

WestCoastProjects


1 Answers

Set the --progress=plain option, so modify the build command as follows:

docker build -t "setuppython" --progress=plain .

Alternatively, you can set the BUILDKIT_PROGRESS environment variable (documented here) instead of explicitly setting this option for each individual build command, like so:

export BUILDKIT_PROGRESS=plain

The --progress argument and/or the BUILDKIT_PROGRESS environment variable accept the values auto, plain, and tty. Using tty, the output will try to be "nicer" for interactive terminals (so it overwrites itself), and plain will simply output everything. The auto setting (default) will try to determine which of the two is more appropriate for the current environment.

like image 132
micromoses Avatar answered Jan 25 '26 21:01

micromoses



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!