caught blind case if engine fails to build when both not installed
This commit is contained in:
parent
971e5749f4
commit
df637acee4
1 changed files with 12 additions and 13 deletions
13
pkg-install
13
pkg-install
|
@ -48,14 +48,11 @@ ENTRYPOINT [\"/usr/bin/env\", \"{command}\"]"
|
||||||
|
|
||||||
# check if either docker or podman are installed
|
# check if either docker or podman are installed
|
||||||
|
|
||||||
docker_check = which("docker")
|
try:
|
||||||
|
if which("docker") is None:
|
||||||
podman_check = which("podman")
|
|
||||||
|
|
||||||
if docker_check is None:
|
|
||||||
print("Docker not installed, building with Podman")
|
print("Docker not installed, building with Podman")
|
||||||
engine = "podman"
|
engine = "podman"
|
||||||
elif podman_check is None:
|
elif which("podman") is None:
|
||||||
engine = "docker"
|
engine = "docker"
|
||||||
else:
|
else:
|
||||||
print("Podman/Docker are not installed! Exiting...")
|
print("Podman/Docker are not installed! Exiting...")
|
||||||
|
@ -63,4 +60,6 @@ else:
|
||||||
|
|
||||||
|
|
||||||
subprocess.run([engine, "build", "-t", command, "-"], input = dockerfile, encoding = 'UTF-8')
|
subprocess.run([engine, "build", "-t", command, "-"], input = dockerfile, encoding = 'UTF-8')
|
||||||
|
except FileNotFoundError:
|
||||||
|
print("An Error has occured while attempting to build the image.")
|
||||||
|
exit(1)
|
||||||
|
|
Loading…
Reference in a new issue