Capture ouput of docker build into a log file?

Is there extra magic that you need to do on a Mac? I ran

docker build \
       -t my-image:latest \
       -f docker/Dockerfile \
       --build-arg SOME_ARG=value \
       --target sometarget \
       --progress=plain \
       .

inside a script, and launched the script as

my-script.sh 2>&1 > build.log

but build.log was empty when I was done

1 Like