BUILDX_EXPERIMENTAL=1 docker buildx debug --invoke bash build --progress=plain
Optionally, you can add --on=error
to only start the shell if an error occurs.
--progress=plain
is important because the shell will act really weird without it
More about this: https://github.com/docker/buildx/blob/master/docs/debugging.md