Users may notice errors with their existing Docker containers and the entrypoint scripts used as the behavior for this differs between Docker and Singularity.
/.singularity.d/runscript: line 39: /path/to/where/you/ran/it/from/entrypoint_script.sh: No such file or directory
This error may happen when running Singularity using a converted docker image. The singularity image cannot find the entrypoint script referred to in the Docker container.
Why this issue happens:
The most likely cause for this is that relative paths are being used in the Dockerfile to run the entrypoint. For example, the end of the Dockerfile might look something like this:
# changes working directory to /code
ENTRYPOINT [ "entrypoint_script.sh" ]
The expected behavior is that it works similar to docker, namely when the Docker container starts up, it goes to /code and runs the script. However, Singularity does not really pay attention to the WORKDIR command (discussed here), so when you run the Singularity image, it just searches for the entrypoint script in the directory from which you ran the image. Of course the entrypoint isn't there, hence the error.
If you have access to the Dockerfile, the most straightforward solution is to have the entrypoint be an absolute path, for example something like:
ENTRYPOINT [ "/code/entrypoint_script.sh" ]
This ensures that Singularity will always go to the correct location for the script. If the script needs a change in working directory to properly run, our recommendation would be to 'cd' to whatever directory is needed at the start of the entrypoint script, or do it somehow else inside the script, not the Dockerfile.
If you don't have access to the Dockerfile, the best option might be to go into the Docker container and try and find where the entrypoint is or make a new singularity/docker image that is based off of the other one and make your own entrypoint script.
Regardless, the basic idea is make sure that your script doesn't rely on relative directories and make sure to have the full path to the script when trying to run it, since Singularity doesn't care about the Docker WORKDIR command.