diff --git a/cwltool/singularity.py b/cwltool/singularity.py index 5d1e25c73..2f590a140 100644 --- a/cwltool/singularity.py +++ b/cwltool/singularity.py @@ -186,7 +186,13 @@ def get_image( file.write(singularityfile) os.environ["APPTAINER_TMPDIR"] = absolute_path - Client.build(recipe=singularityfile_path, build_folder=absolute_path, sudo=False) + singularity_options = ["--fakeroot"] if not shutil.which("proot") else [] + Client.build( + recipe=singularityfile_path, + build_folder=absolute_path, + sudo=False, + options=singularity_options, + ) found = True elif "dockerImageId" not in dockerRequirement and "dockerPull" in dockerRequirement: match = re.search(pattern=r"([a-z]*://)", string=dockerRequirement["dockerPull"]) diff --git a/tox.ini b/tox.ini index 3f7673a91..cd7fc0702 100644 --- a/tox.ini +++ b/tox.ini @@ -40,6 +40,7 @@ passenv = GITHUB_* PROOT_NO_SECCOMP APPTAINER_TMPDIR + SINGULARITY_FAKEROOT extras = py3{8,9,10,11,12}-unit: deps