Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Singularity in docker container?

I have a question about the official Snakemake container image.
https://hub.docker.com/r/snakemake/snakemake/dockerfile

In this Dockerfile, singularity will be installed. As far as I know, the --privileged argument seems to be required to use singularity in a docker container.
docker run -it --privileged snakemake/snakemake ........

However, I think the --privileged argument is insecure from a security standpoint, so it would be preferable not to use it if possible.

Can anyone tell me the proper way to use singularity in a docker container?

Thanks,

like image 783
tetsuro90 Avatar asked Feb 12 '26 22:02

tetsuro90


1 Answers

The --privileged flag is the recommended and only way to run singularity in Docker.

Use of --privileged is not bad in itself, it is also used for running Docker-in-Docker, but it does allow the possibility of container escape. Follow best practices, build your own images and you should be okay.

like image 172
tsnowlan Avatar answered Feb 15 '26 12:02

tsnowlan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!