Skip to content

Commit 18ca45d

Browse files
committed
Look for podman if docker isn't present
1 parent a4d2f7e commit 18ca45d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

template_sources/scripts/{% if application_type in ['Nova Application', 'NDIP Tool', 'Tutorial'] %}utils.py{% endif %}.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
import subprocess
44
import sys
5+
from shutil import which
56

67
import git
78

9+
DOCKER_COMMAND = "docker" if which("docker") is not None else "podman"
10+
811

912
def check_docker_image_exists(image_url: str) -> bool:
1013
"""
@@ -22,7 +25,7 @@ def check_docker_image_exists(image_url: str) -> bool:
2225
# The '--quiet' option minimizes output
2326
print(f"Attempting to verify container exists: {image_url}.")
2427
result = subprocess.run(
25-
["docker", "manifest", "inspect", image_url], capture_output=True, text=True, check=False
28+
[DOCKER_COMMAND, "manifest", "inspect", image_url], capture_output=True, text=True, check=False
2629
)
2730

2831
# If the command exited with 0, the image exists

0 commit comments

Comments
 (0)