How to check if build is completed successfully?

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?

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

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