I have a very basic question about docker and singularity. I'd like to be able to run a docker container using both docker and singularity, but I'm confused about the difference between the working directory. Here's an example: INSIDE my docker container, I have main.sh
and test.sh
.
Content of main.sh
:
#!/bin/bash
echo "Executing main.sh"
./test.sh
Content of test.sh
:
#!/bin/bash
echo "Executing test.sh"
When executing the following:
sudo docker run -t myuser/mydocker:1.0 ./main.sh
I get the expected output:
Executing main.sh
Executing test.sh
But when executing singularity exec -e docker://myuser/mydocker:1.0 /main.sh
I get this error:
Executing main.sh
/main.sh: line 4: ./test.sh: No such file or directory
Why is test.sh
not accessible? Is there a way to let it work through singularity without changing the content of main.sh
? My singularity version is 3.6.3.
Thank you!
question from:https://stackoverflow.com/questions/65642199/difference-between-working-directory-of-docker-and-singularity