add again the --security-opt flag

Had previously been added but removed in a refactor (see commit
488dca).
This commit is contained in:
deeplow 2022-08-10 17:32:36 +01:00
parent e63c931800
commit a02801cc2d
No known key found for this signature in database
GPG key ID: 577982871529A52A

View file

@ -77,13 +77,18 @@ def convert(input_filename, output_filename, ocr_lang, stdout_callback):
if container_tech == "docker":
platform_args = ["--platform", "linux/amd64"]
security_args = ["--security-opt=no-new-privileges:true"]
else:
platform_args = []
security_args = ["--security-opt", "no-new-privileges"]
# Convert document to pixels
args = (
["run", "--network", "none"]
+ platform_args
+ security_args
+ [
"-v",
f"{input_filename}:/tmp/input_file",
@ -105,6 +110,7 @@ def convert(input_filename, output_filename, ocr_lang, stdout_callback):
args = (
["run", "--network", "none"]
+ platform_args
+ security_args
+ [
"-v",
f"{pixel_dir}:/dangerzone",