Scroll to navigation

RUN-SINGULARITY(1) User Commands RUN-SINGULARITY(1)

NAME

run-singularity - launch a Singularity containers with a runscript

DESCRIPTION

Run the user-defined default command within a container

Usage:

singularity run [run options...] <container>

Description:

This command will launch a Singularity container and execute a runscript if one is defined for that container. The runscript is a metadata file within the container that contains shell commands. If the file is present (and executable) then this command will execute that file within the container automatically. All arguments following the container name will be passed directly to the runscript.
singularity run accepts the following 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.
sandbox format. Directory containing a valid root file system and optionally Singularity meta-data.
instance://*
A local running instance of a container. (See the instance command group.)
library://*
A SIF container hosted on a Library (default https://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

a comma separated capability list to add
allow setuid binaries in container (root only)
set an application to run inside a container
apply cgroups from file for container processes (root only)
a user-bind path specification. spec has the format src[: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 as 'ro' (read-only) or 'rw' (read/write, which is the default). Multiple bind paths can be given by a comma separated list.
clean environment before running container
apply settings for increased OCI/Docker compatibility. Infers --containall, --no-init, --no-umask, --writable-tmpfs.
use minimal /dev and empty other directories (e.g. /tmp and $HOME) instead of sharing filesystems from your host
contain not only file systems, but also PID, IPC, and environment
dont use cache, and dont create cache
list of DNS server separated by commas to add in resolv.conf
login to a Docker Repository interactively
a comma separated capability list to drop
pass environment variable to contained process
pass environment variables from file to contained process
run container in new user namespace as uid 0
A FUSE filesystem mount specification of the form '<type>:<fuse command> <mountpoint>' - where <type> is 'container' or 'host', specifying where the mount will be performed ('container-daemon' or 'host-daemon' will 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.
help for run
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/buildd")
set container hostname
run container in a new IPC namespace
let root user keep privileges in container (root only)
a mount specification e.g. 'type=bind,source=/opt,destination=/hostopt'.
run container in a new network namespace (sets up a bridge network interface by default)
specify desired network type separated by commas, each network will bring up a dedicated interface inside container (default "bridge")
specify network arguments to pass to CNI plugins
do NOT mount users home directory if /home is not the current working directory
use http instead of https for docker:// oras:// and library://<hostname>/... URIs
do NOT start shim process with --pid
disable one or more mount xxx options set in singularity.conf
drop all privileges from root user in container)
do not propagate umask to the container, set default 0022 umask
enable Nvidia support
use nvidia-container-cli for GPU setup (experimental)
use an overlayFS image for persistent data storage or as read-only layer of container
prompt for an encryption passphrase
enter an path to a PEM formatted RSA key for an encrypted container
run container in a new PID namespace
initial working directory for payload process inside the container
enable experimental Rocm support
include a scratch directory within the container that is linked to a temporary dir (use -W to force location)
enable security features (SELinux, Apparmor, Seccomp)
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.
run container in a new UTS namespace
enable VM support
number of CPU cores to allocate to Virtual Machine (implies --vm) (default "1")
enable attaching stderr from VM
IP Address to assign for container usage. Defaults to DHCP within bridge network. (default "dhcp")
amount of RAM in MiB to allocate to Virtual Machine (implies --vm) (default "1024")
working directory to be used for /tmp, /var/tmp and $HOME (if -c/--contain was also used)
by default all Singularity containers are available as read only. This option makes the file system accessible as read/write.
makes the file system accessible as read-write with non persistent data (with overlay support only)

EXAMPLES

# 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/

February 2022 run-singularity 3.9.5+ds1-1