Skip to content

Commit

Permalink
Merge pull request #62 from shanejbrown/main
Browse files Browse the repository at this point in the history
Change failed image clean-up to warning and fix None path bug
  • Loading branch information
shanejbrown authored Aug 28, 2023
2 parents 6906d18 + bc41bbc commit 3d52c55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion buildrunner/docker/multiplatform_image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ def _build_single_image(self,
images = docker.image.pull(tag_name)
assert images, f"Failed to build {tag_name}"
image_id = docker.image.inspect(tag_name).id
docker.image.remove(images, force=True)
# Removes the image from host, if this fails it is considered a warning
try:
docker.image.remove(images, force=True)
except python_on_whales.exceptions.DockerException as err:
LOGGER.warning(f"Failed to remove {images}: {err}")
except python_on_whales.exceptions.DockerException as err:
LOGGER.error(f"Failed to build {tag_name}: {err}")
raise err
Expand Down
2 changes: 1 addition & 1 deletion buildrunner/steprunner/tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
self._docker_client = buildrunner.docker.new_client(
timeout=step_runner.build_runner.docker_timeout,
)
self.path = None
self.path = '.'
self.dockerfile = None
self.to_inject = {}
self.image_to_prepend_to_dockerfile = image_to_prepend_to_dockerfile
Expand Down

0 comments on commit 3d52c55

Please sign in to comment.