# How to debug build failures

**URL:** <https://forums.docker.com/t/how-to-debug-build-failures/7049>\
**Category:** General\
**Created:** [March 4, 2016, 12:01am UTC](https://forums.docker.com/t/how-to-debug-build-failures/7049 "2016-03-04T00:01:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![honglilai](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/honglilai/32/15650_2.png) [@honglilai](https://forums.docker.com/u/honglilai)\
**Post date:** [August 30, 2019, 5:38am UTC](https://forums.docker.com/t/how-to-debug-build-failures/7049/3 "2019-08-30T05:38:42Z")

</div>

Sometimes it’s useful to inspect the filesystem of the step that failed, not just the last good step. I’ve [written a guide on how to debug docker builds like that](https://www.joyfulbikeshedding.com/blog/2019-08-27-debugging-docker-builds.html). In short, look at the container ID of the failed step, then commit that to a temporary image, then run ‘sh’ (or ‘env’ or whatever) from that temporary image.

```auto
docker commit d590aa9618dc mytempimage
docker run -ti --rm mytempimage sh

```

---

_[View the full topic](https://forums.docker.com/t/how-to-debug-build-failures/7049)._
