Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile: RUN ls -l [duplicate]

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?

like image 980
joeforker Avatar asked Nov 21 '25 07:11

joeforker


2 Answers

Have you tried --progress=plain?

Example:

  • Dockerfile

    FROM alpine
    RUN ps aux
    
  • build command:

    DOCKER_BUILDKIT=1 docker build --progress=plain -t test_buildkit .
    

Relative output:

#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

👉 Also, check the very useful answer by @Cocowalla below about BUILDKIT_PROGRESS=plain

like image 172
tgogos Avatar answered Nov 24 '25 06:11

tgogos


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.

like image 39
Cocowalla Avatar answered Nov 24 '25 06:11

Cocowalla



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!