Skip to content

Commit

Permalink
Merge pull request #774 from chrispyles/docker-build-error
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispyles committed Feb 9, 2024
2 parents 926e263 + a2ebaea commit b484544
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions otter/grade/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ def build_image(ag_zip_path: str, base_image: str, tag: str, config: AutograderC
old_config.update(config.get_user_config())
config_path.write_text(json.dumps(old_config.get_user_config()))

docker.build(
temp_dir,
build_args={"BASE_IMAGE": base_image},
tags=[image],
file=dockerfile_path,
load=True,
)
try:
docker.build(
temp_dir,
build_args={"BASE_IMAGE": base_image},
tags=[image],
file=dockerfile_path,
load=True,
)
except TypeError as e:
raise TypeError(
f"Docker build failed; if this is your first time seeing this error, ensure that " \
"Docker is running on your machine.\n\nOriginal error: {e}")

return image

Expand Down

0 comments on commit b484544

Please sign in to comment.