How to debug when docker build fails

Other topics

basic example

As the last layer created by

docker build -t mytag .

showed

---> Running in d9a42e53eb5a

You just launch the last created image with a shell and launch the command, and you will have a more clear error message

docker run -it d9a42e53eb5a /bin/bash

(this assumes /bin/bash is available, it may be /bin/sh or anything else)

and with the prompt, you launch the last failing command, and see what is displayed

Contributors

Topic Id: 8078

Example Ids: 26051

This site is not affiliated with any of the contributors.