When running containers, explictly use path to python3 and .py file, and --force when deleting the obsolete image

This commit is contained in:
Micah Lee 2021-11-29 16:33:55 -08:00
parent 7e74371edd
commit 1d08e12f5e
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 5 additions and 3 deletions

View file

@ -85,7 +85,8 @@ def convert(input_filename, output_filename, ocr_lang, stdout_callback):
"-v",
f"{pixel_dir}:/dangerzone",
container_name,
"dangerzone.py",
"/usr/bin/python3",
"/usr/local/bin/dangerzone.py",
"document-to-pixels",
]
ret = exec_container(args, stdout_callback)
@ -110,7 +111,8 @@ def convert(input_filename, output_filename, ocr_lang, stdout_callback):
"-e",
f"OCR_LANGUAGE={ocr_lang}",
container_name,
"dangerzone.py",
"/usr/bin/python3",
"/usr/local/bin/dangerzone.py",
"pixels-to-pdf",
]
ret = exec_container(args, stdout_callback)

View file

@ -485,7 +485,7 @@ class GlobalCommon(object):
print(f"Deleting old dangerzone container image")
subprocess.check_output(
[self.get_container_runtime(), "rmi", found_image_id],
[self.get_container_runtime(), "rmi", "--force", found_image_id],
startupinfo=self.get_subprocess_startupinfo(),
)