Docker Community Forums

Share and learn in the Docker community.

How to check if build is completed successfully?


(Pregmatch) #1

I want to write test in python for container build with subprocess, where in subprocess I have some bash script that says docker build .

Is there any way that I can check if container is build without visual inspection of build output?


(Sven Dowideit) #2

You can use the exit code - which generally should be 0 on success, and set to the failure code of the INSTRUCTION otherwise


(Sven Dowideit) #3

mmm, on investigation - it looks like docker build returns 1 - and has a string `INFO[0000] The command […] returned a non-zero code: 13

added some docs: https://github.com/docker/docker/pull/10816