-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progress: disable truncating by default when using --progress=plain #1435
Conversation
Currently, `docker build --progress=plain` truncates output, which makes it difficult to debug problems during build (the step that failed may not be the cause of the failure). For example, in the following build, the output of the `RUN echo ...` is truncated: DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain -t foo -<<EOF FROM busybox RUN echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ut lorem nec leo euismod vestibulum. Donec tortor nisl, iaculis at vehicula vel, interdum eu orci. Integer velit lacus, congue id magna eu, mollis accumsan augue. Aliquam non venenatis risus, eu posuere libero. Vestibulum ante ipsum primis in faucibus orci luctus." > /somewhere RUN echo "something went wrong"; exit 1 EOF #5 [2/3] RUN echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit.... #5 DONE 0.2s #6 [3/3] RUN echo "something went wrong"; exit 1 #6 0.211 something went wrong #6 ERROR: executor failed running [/bin/sh -c echo "something went wrong"; exit 1]: runc did not terminate sucessfully ------ > [3/3] RUN echo "something went wrong"; exit 1: ------ failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c echo "something went wrong"; exit 1]: runc did not terminate sucessfully While there is an existing `PROGRESS_NO_TRUNC` environment variable, I think that this should be the default if the user opted to use `--progress=plain` (or in situations where no TTY is attached, which could be in CI). This patch changes the default to disable truncating in those situations, but allowing users to opt-out by setting `PROGRESS_NO_TRUNC=0` With this change the same build looks like this: #5 [2/3] RUN echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ut lorem nec leo euismod vestibulum. Donec tortor nisl, iaculis at vehicula vel, interdum eu orci. Integer velit lacus, congue id magna eu, mollis accumsan augue. Aliquam non venenatis risus, eu posuere libero. Vestibulum ante ipsum primis in faucibus orci luctus." > /somewhere #5 sha256:b2f0f47d63911ee55e7cf17c81007310e28190b5be84aa1a7869ba90786d5cee #5 DONE 0.2s #6 [3/3] RUN echo "something went wrong"; exit 1 #6 sha256:c037b34bb998ae7d30572b489286da14df87e1478adf6d0c5c71c79b84b11bcc #6 0.293 something went wrong #6 ERROR: executor failed running [/bin/sh -c echo "something went wrong"; exit 1]: runc did not terminate sucessfully ------ > [3/3] RUN echo "something went wrong"; exit 1: ------ failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c echo "something went wrong"; exit 1]: runc did not terminate sucessfully Signed-off-by: Sebastiaan van Stijn <[email protected]>
The idea behind the truncation even on plain mode was that the prefix numbers stay aligned. Do you have screenshots on how this looks compared to old. There is also the |
Here's two screenshots (I used Before: After:
Do you think we should "hard" wrap the lines and align with the prefix number? |
This isn't possible without knowing the actual screen width. And if we are on tty then this view isn't shown anyway by default. |
fixes #1412
Currently,
docker build --progress=plain
truncates output, which makes itdifficult to debug problems during build (the step that failed may not be the
cause of the failure).
For example, in the following build, the output of the
RUN echo ...
is truncated:While there is an existing
PROGRESS_NO_TRUNC
environment variable, I think thatthis should be the default if the user opted to use
--progress=plain
(or insituations where no TTY is attached, which could be in CI).
This patch changes the default to disable truncating in those situations, but
allowing users to opt-out by setting
PROGRESS_NO_TRUNC=0
With this change the same build looks like this: