Add error checking after calling docker.buildImage