RUN-SINGULARITY(1)
π run-singularity π
okay so you opened the manual page for run-singularity, which lives in the User Commands corner of the man pages, and honestly? you ate by coming here. This is the whole entire guide to launching a Singularity container with a runscript. Buckle up bestie, it's a long one but every single flag matters. π«Ά
πΈ DESCRIPTION πΈ
π Usage:
singularity run [run options...] <container>
π§ Description:
So here's the tea β β this command launches a Singularity container and executes a runscript if one is defined for that container. The runscript is literally a metadata file inside the container that holds shell commands. If that file is present (and executable, that part is doing a lot of work π ) then this command will just go ahead and execute that file inside the container, automatically, no extra steps. And every argument you put after the container name gets passed directly to the runscript. periodt.
singularity run accepts these container formats:
*.sifβ Singularity Image Format (SIF). Native to Singularity 3.0+*.sqshβ SquashFS format. Native to Singularity 2.4+*.imgβ ext3 format. Native to Singularity versions < 2.4.directory/β sandbox format. Directory containing a valid root file system and optionally Singularity meta-data.instance://*β A local running instance of a container. (See theinstancecommand group.)library://*β A SIF container hosted on a Library (defaulthttps://cloud.sylabs.io/library)docker://*β A Docker/OCI container hosted on Docker Hub or another OCI registry.shub://*β A container hosted on Singularity Hub.oras://*β A SIF container hosted on an OCI registry that supports the OCI Registry As Storage (ORAS) specification.
β¨ OPTIONS β¨
okay this is the part where I need you to lock in π₯. Every flag, every default, exactly as it is:
--add-capsstring β a comma separated capability list to add--allow-setuidβ allow setuid binaries in container (root only)--appstring β set an application to run inside a container--apply-cgroupsstring β apply cgroups from file for container processes (root only)--authfilestring β Docker-style authentication file to use for writing/reading OCI registry credentials-B,--bindstrings β a user-bind path specification. spec has the formatsrc[:dest[:opts]], where src and dest are outside and inside paths. If dest is not given, it is set equal to src. Mount options ('opts') may be specified asro(read-only) orrw(read/write, which is the default). Multiple bind paths can be given by a comma separated list.--blkio-weightint β Block IO relative weight in range 10-1000, 0 to disable--blkio-weight-devicestrings β Device specific block IO relative weight--cdi-dirsstrings β comma-separated list of directories in which CDI should look for device definition JSON files. If omitted, default will be:/etc/cdi,/var/run/cdi-e,--cleanenvβ clean environment before running container--compatβ apply settings for increased OCI/Docker compatibility. Infers--containall,--no-init,--no-umask,--no-eval,--writable-tmpfs.-c,--containβ use minimal/devand empty other directories (e.g./tmpand$HOME) instead of sharing filesystems from your host-C,--containallβ contain not only file systems, but also PID, IPC, and environment--cpu-sharesint β CPU shares for container (default-1)--cpusstring β Number of CPUs available to container--cpuset-cpusstring β List of host CPUs available to container--cpuset-memsstring β List of host memory nodes available to container--cwdstring β initial working directory for payload process inside the container (synonym for--pwd)--devicestrings β fully-qualified CDI device name(s). A fully-qualified CDI device name consists of a VENDOR, CLASS, and NAME, which are combined as follows:<VENDOR>/<CLASS>=<NAME>(e.g.vendor.com/device=mydevice). Multiple fully-qualified CDI device names can be given as a comma separated list.--disable-cacheβ dont use cache, and dont create cache--dnsstring β list of DNS server separated by commas to add in resolv.conf--docker-hoststring β specify a custom Docker daemon host--docker-loginβ login to a Docker Repository interactively--drop-capsstring β a comma separated capability list to drop--envstringToString β pass environment variable to contained process (default[])--env-filestring β pass environment variables from file to contained process-f,--fakerootβ run container in new user namespace as uid 0--fusemountstrings β A FUSE filesystem mount specification of the form<type>:<fuse command> <mountpoint>β where<type>iscontainerorhost, specifying where the mount will be performed (container-daemonorhost-daemonwill run the FUSE process detached).<fuse command>is the path to the FUSE executable, plus options for the mount.<mountpoint>is the location in the container to which the FUSE mount will be attached. E.g.container:sshfs 10.0.0.1:/ /sshfs. Implies--pid.-h,--helpβ help for run-H,--homestring β a home directory specification. spec can either be a src path or src:dest pair. src is the source path of the home directory outside the container and dest overrides the home directory within the container. (default"$HOME")--hostnamestring β set container hostname. Infers--uts.-i,--ipcβ run container in a new IPC namespace--keep-layersβ Keep layers when creating an OCI-SIF. Do not squash to a single layer.--keep-privsβ let root user keep privileges in container (root only)--memorystring β Memory limit in bytes--memory-reservationstring β Memory soft limit in bytes--memory-swapstring β Swap limit, use-1for unlimited swap--mountstringArray β a mount specification e.g.type=bind,source=/opt,destination=/hostopt.-n,--netβ run container in a new network namespace (sets up a bridge network interface by default)--networkstring β specify desired network type separated by commas, each network will bring up a dedicated interface inside container (default"bridge")--network-argsstrings β specify network arguments to pass to CNI plugins--no-compatβ (--ocimode) do not apply settings for increased OCI/Docker compatibility. Emulate native runtime defaults without--containetc.--no-evalβ do not shell evaluate env vars or OCI container CMD/ENTRYPOINT/ARGS--no-homeβ do NOT mount users home directory if/homeis not the current working directory--no-httpsβ use http instead of https fordocker://oras://andlibrary://<hostname>/...URIs--no-initβ do NOT start shim process with--pid--no-mountstrings β disable one or more 'mount xxx' options set in singularity.conf, specify absolute destination path to disable a bind path entry, or 'bind-paths' to disable all bind path entries.--no-ociβ Launch container with native runtime--no-pidβ do not run container in a new PID namespace--no-privsβ drop all privileges in container (root only in non-OCI mode)--no-setgroupsβ disable setgroups when entering--fakerootuser namespace--no-tmp-sandboxβ Prohibits unpacking of images into temporary sandbox dirs--no-umaskβ do not propagate umask to the container, set default 0022 umask--nvβ enable Nvidia support--nvccliβ use nvidia-container-cli for GPU setup (experimental)--ociβ Launch container with OCI runtime (experimental)--oom-kill-disableβ Disable OOM killer-o,--overlaystrings β use an overlayFS image for persistent data storage or as read-only layer of container--passphraseβ prompt for an encryption passphrase--pem-pathstring β enter an path to a PEM formatted RSA key for an encrypted container-p,--pidβ run container in a new PID namespace--pids-limitint β Limit number of container PIDs, use-1for unlimited--rocmβ enable experimental Rocm support-S,--scratchstrings β include a scratch directory within the container that is linked to a temporary dir (use-Wto force location)--securitystrings β enable security features (SELinux, Apparmor, Seccomp)--tmp-sandboxβ Forces unpacking of images into temporary sandbox dirs when a kernel or FUSE mount would otherwise be used.-u,--usernsβ run container in a new user namespace, allowing Singularity to run completely unprivileged on recent kernels. This disables some features of Singularity, for example it only works with sandbox images.--utsβ run container in a new UTS namespace-W,--workdirstring β working directory to be used for/tmpand/var/tmp(if-c/--containwas also used)-w,--writableβ by default all Singularity containers are available as read only. This option makes the file system accessible as read/write.--writable-tmpfsβ makes the file system accessible as read-write with non persistent data (with overlay support only)
π heads up bestie: a couple of these are marked (experimental) β--nvccliand--ociβ and several are (root only). Also-u/--usernsdisables some features of Singularity. Don't say I didn't warn you. π
π EXAMPLES π
okay these are the examples, exactly as they show up in the page (the line wrapping is doing its thing, but I'm not touching a single character of it π):
# Here we see that the runscript prints "Hello world: " $
singularity exec /tmp/debian.sif cat /singularity #!/bin/sh echo
"Hello world: "
# It runs with our inputs when we run the image $ singularity run
/tmp/debian.sif one two three Hello world: one two three
# Note that this does the same thing $ ./tmp/debian.sif one two
three
For additional help or support, please visit https://www.sylabs.io/docs/
and that's the whole page bestie, you're officially a run-singularity girlie now π
this was run-singularity version 4.1.5+ds4-1, from February 2025, and yes the man page name up top is RUN-SINGULARITY(1) β slay β¨ π
π¦ where this page comes from
- ubuntu resolute: singularity-container 4.1.5+ds4-1 Β· BSD-3-Clause-LBNL AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms