Cannot see any dangling images after a build fails (wsl2)

Previously I could always get the “<none>” dangling images when an step in Dockerfile failed, then use that to run and debug. But now, after a build fails there remains no dangling images shown in “docker images” and neither any thing in docker ps -a

Running Docker Desktop 4.40.0 (187762)

$ docker --version
Docker version 28.0.4, build b8034c0
$ docker context ls
NAME            DESCRIPTION                               DOCKER ENDPOINT                             ERROR
default *       Current DOCKER_HOST based configuration   unix:///var/run/docker.sock
desktop-linux   Docker Desktop                            npipe:////./pipe/dockerDesktopLinuxEngine

The old, legacy builder that actually ran Docker containers worked differently. Now there is no Docker container to show when the build fails. I don’t remember how image layers were handled, but you don’t need any image layer to be able to debug if the error is not random. You can add debug commands directly to the Dockerfile and use --progress plain to show all the outputs, not just error messages and add --no-cache to run the commands every time, or you can also temporarily remove the failing instruction and everything after it, so you have a working image and start an interactive container to run the rest of the commands.