When building Docker images with DOCKER_BUILDKIT=1
, there is a very cool progress indicator but no command output. How do I see the command output to debug my build?
Asked
Active
Viewed 8,500 times
47
2 Answers
62
Have you tried --progress=plain
?
Example:
FROM alpine
RUN ps aux
Relative output of DOCKER_BUILDKIT=1 docker build --progress=plain -t test_buildkit .
:
#5 [2/2] RUN ps aux
#5 digest: sha256:e2e4ae1e7db9bc398cbcb5b0e93b137795913d2b626babb0f148a60017379d86
#5 name: "[2/2] RUN ps aux"
#5 started: 2019-04-19 09:02:58.922035874 +0000 UTC
#5 0.693 PID USER TIME COMMAND
#5 0.693 1 root 0:00 ps aux
#5 completed: 2019-04-19 09:02:59.721490002 +0000 UTC
#5 duration: 799.454128ms
![](../../users/profiles/1561148.webp)
tgogos
- 16,343
- 14
- 77
- 108
-
1Also, make sure that the layer where print output is expected is not cached (`--no-cache `). Otherwise, it won't print the expected output. – zdebra May 19 '21 at 11:40
40
As well as using --progress=plain
on the command line, you can also set an environment variable:
BUILDKIT_PROGRESS=plain
I find this particularly useful for CI builds, where I always want the full log.
![](../../users/profiles/25758.webp)
Cocowalla
- 11,717
- 5
- 58
- 93
-
2Thank you! This is very useful when using docker-compose as you can't pass there --progress option. – Kamil Dziedzic Oct 13 '20 at 16:13