Display docker error
Display error if any docker container creation fail
This commit is contained in:
parent
45df9053ff
commit
f941240fea
|
|
@ -22,12 +22,18 @@ def build_image(path, tag, buildargs={}):
|
|||
|
||||
logger.debug(f"DOCKER COMMAND:\n\n{debug_docker_command}\n")
|
||||
docker_client = get_docker_client()
|
||||
|
||||
try:
|
||||
image = docker_client.images.build(
|
||||
path=str(path),
|
||||
tag=tag,
|
||||
buildargs=buildargs,
|
||||
)
|
||||
logger.debug("Image build.")
|
||||
logger.debug("Image build done.")
|
||||
except docker.errors.BuildError as buildError:
|
||||
logger.error("\n".join(buildError.build_log))
|
||||
logger.error("Image build failed.")
|
||||
|
||||
return image
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user