t1m0th33
t1m0th33

Reputation: 166

How to redirect docker build output to a file?

I'm trying to store the logs of the build process in a file from this command for example:

docker build -t python:3.8.5 . --progress=plain

Would expect to work with this command:

docker build -t python:3.8.5 . --progress=plain >> builder.log

Can't find in the doc how to do it.

Thanks for your help.

Upvotes: 5

Views: 4621

Answers (1)

Paolo
Paolo

Reputation: 26285

You can use:

docker build -t python:3.8.5 . --progress=plain > builder.log 2>&1

to redirect both stderr and stdout to builder.log

Upvotes: 12

Related Questions