Debugging Docker compose builds with BUILDKIT_PROGRESS

Recently I needed to debug some output in my docker compose build process, but was frustrated by the lack of output in the terminal.

The default accordion-esque style works nicely when building Docker images routinely, but is unusable when trying to debug what's going on inside your build process.

But I found out that you can use:

BUILDKIT_PROGRESS=plaintext

Which outputs the entire build process as a regular stdout log stream!


The full command I used to "quickly" (ha, as if any docker build is "quick") iterate over my docker compose build was this:

BUILDKIT_PROGRESS=plaintext docker compose build

(I also found out that you can use docker compose build instead of docker compose up --build. The semantics are nicer when you're just trying to get the image, not run the entire service. Of course, you could also just use regular Docker for this.)