Merge branch 'display_docker_error' into 'main'

[IMP] Display docker error

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!79
This commit is contained in:
LE GAL SYLVAIN 2024-09-30 14:39:55 +00:00
commit 4536c52558

View File

@ -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()
image = docker_client.images.build(
path=str(path),
tag=tag,
buildargs=buildargs,
)
logger.debug("Image build.")
try:
image = docker_client.images.build(
path=str(path),
tag=tag,
buildargs=buildargs,
)
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