Docker Community Forums

Share and learn in the Docker community.

Feature request: docker build --verbose

We have the following step in one of our dockerfiles:

RUN mkdir -p ${BUILD_DIR} \
    && cd ${BUILD_DIR} \
    && cmake \
        -DUSE_FEATURE_FOO=${USE_FEATURE_FOO} \
        -DUSE_FEATURE_BAR=${USE_FEATURE_BAR} \
        -DUSE_FEATURE_BAZ=${USE_FEATURE_BAZ} \
        /src \
    && make --jobs ${MAKE_JOBS} ${BUILD_TARGET}

When we run docker build, the following is output:

RUN mkdir -p /src/.build/release     && cd /src/.build/release...

The flags which were enabled in this build are not printed.

It would be really useful to be able to enable verbose output, and have the entire RUN command printed out.

For example, running docker build --no-cache --progress=tty with

this Dockerfile
shows this log during the actual building process
but then collapses the output to this shorter log after the build is complete.
This behavior is undesirable, since most developers (in my experience) want to be able to look at the full logs during the build and after the build. The currently “recommended” way to get the full logs is to use --progress=plain.

However, running docker build --no-cache --progress=plain with the same Dockerfile results in

this unreadable mess, where the logs from different parallel stages are mixed together.
So in short, --progress=tty only shows the last 6 lines from each build and clears the logs after the build is done and --progress=plain can’t handle parallel builds properly and is overall actually quite ugly. In my opinion, we really need a --progress=verbose option, which would act exactly like --progress=tty, but the logs will not be limited to 6 lines and they will not get erased after the build step is complete.

I might be wrong, but I can’t imagine that this behavior would be hard to implement, since you just need to turn off the log “truncation” at 7 lines and after the build step finishes.