apptainer(1)
π NAME β¨
okay so welcome to the apptainer(1) manual, bestie β this specific page is apptainer-run and it's literally "Run the user-defined default command within a container". that's the whole vibe. π«Ά
π SYNOPSIS
apptainer run [run options...] [args...]
π¦ DESCRIPTION
this command launches an Apptainer container and executes a runscript if one is defined for that container. and what even is a runscript? it's a metadata file inside the container that contains shell commands β like a lil to-do list of shell stuff the container ships with. if that file is present (and executable) then this command will execute that file within the container automatically, no extra steps, no cap. β¨
any arguments you put after the container name get passed directly to the runscript, so it's giving "your args are the runscript's args now" π
π container formats apptainer run accepts (the whole lineup, no gatekeeping)
.sif- Singularity Image Format (SIF)- Native to Singularity 3.0+ and all Apptainer versions. the icon. the main character. π
.sqsh- SquashFS format- Native to Singularity 2.4+ and < 3.0.
.img- ext3 format- Native to Singularity versions < 2.4. vintage, honestly. π«Ά
directory/- sandbox format- Directory containing a valid root file system and optionally Apptainer meta-data.
instance://- A local running instance of a container. See the instance command group.
library://- A SIF container hosted on a Library (no library enabled by default). β οΈ yes, read that again β no library enabled by default.
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.
ipfs://- A SIF image from an IPFS cluster, using a HTTP gateway.
π OPTIONS
okay this is the long part, hydrate first. every single flag, right here, no skips. π
--add-caps=""β a comma separated capability list to add--allow-setuid[=false]β allow setuid binaries in container (root only)--app=""β set an application to run inside a container--apply-cgroups=""β apply cgroups from file for container processes (root only)--authfile=""β Docker-style authentication file to use for writing/reading OCI registry credentials-B,--bind=[]β 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 as'ro'(read-only) or'rw'(read/write, which is the default). Multiple bind paths can be given by a comma separated list.--blkio-weight=0β Block IO relative weight in range 10-1000, 0 to disable--blkio-weight-device=[]β Device specific block IO relative weight--cdi-dirs=[]β comma-separated list of directories in which CDI should look for device definition JSON files. If omitted and not set inapptainer.conf, default will be:/etc/cdi,/var/run/cdi. Not allowed in suid mode by non-root users.-e,--cleanenv[=false]β clean environment before running container--compat[=false]β apply settings for increased OCI/Docker compatibility. Infers--containall,--no-init,--no-umask,--no-eval,--writable-tmpfs.-c,--contain[=false]β use minimal/devand empty other directories (e.g./tmpand$HOME) instead of sharing filesystems from your host-C,--containall[=false]β contain not only file systems, but also PID, IPC, and environment--cpu-shares=-1β CPU shares for container--cpus=""β Number of CPUs available to container--cpuset-cpus=""β List of host CPUs available to container--cpuset-mems=""β List of host memory nodes available to container--cwd=""β initial working directory for payload process inside the container (synonym for--pwd)--device=[]β fully-qualified CDI device name(s). A fully-qualified CDI device name consists of a VENDOR, CLASS, and NAME, which are combined as follows:/=(e.g.vendor.com/device=mydevice). Multiple fully-qualified CDI device names can be given as a comma separated list.--disable-cache[=false]β do not use or create cache--dns=""β list of DNS server separated by commas to add inresolv.conf--docker-host=""β specify a custom Docker daemon host--docker-login[=false]β login to a Docker Repository interactively--drop-caps=""β a comma separated capability list to drop--env=[]β pass environment variable to contained process--env-file=[]β pass environment variables from file to contained process-f,--fakeroot[=false]β run container with the appearance of running as root--fusemount=[]β A FUSE filesystem mount specification of the form':'- where is'container'or'host', specifying where the mount will be performed ('container-daemon'or'host-daemon'will run the FUSE process detached). is the path to the FUSE executable, plus options for the mount. 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[=false]β help for run-H,--home="/builddir"β a home directory specification. spec can either be a src path orsrc:destpair. src is the source path of the home directory outside the container and dest overrides the home directory within the container.--hostname=""β set container hostname--intel-hpu[=false]β enable Intel(R) Gaudi accelerator support while using a minimal/dev-i,--ipc[=false]β run container in a new IPC namespace--keep-privs[=false]β let root user keep privileges in container (root only)--memory=""β Memory limit in bytes--memory-reservation=""β Memory soft limit in bytes--memory-swap=""β Swap limit, use-1for unlimited swap--mount=[]β a mount specification e.g.'type=bind,src=/opt,dst=/hostopt'.-n,--net[=false]β run container in a new network namespace (sets up a bridge network interface by default)--netns-path=""β join the network namespace at the specified path (as root, or if permitted inapptainer.conf)--network=""β specify desired network type separated by commas, each network will bring up a dedicated interface inside container--network-args=[]β specify network arguments to pass to CNI plugins--no-env=[]β list of environment variables to block from import into container from host environment--no-eval[=false]β do not shell evaluate env vars or OCI containerCMD/ENTRYPOINT/ARGS--no-home[=false]β do NOT mount users home directory if/homeis not the current working directory--no-https[=false]β use http instead of https fordocker://oras://andlibrary:///...URIs--no-init[=false]β do NOT start shim process with--pid--no-mount=[]β disable one or more'mount xxx'options set inapptainer.confand/or specify absolute destination path to disable a bind path entry, or'bind-paths'to disable all bind path entries.--no-pid[=false]β do not run container in a new PID namespace--no-privs[=false]β drop all privileges from root user in container--no-umask[=false]β do not propagate umask to the container, set default0022umask--nv[=false]β enable Nvidia support--nvccli[=false]β usenvidia-container-clifor GPU setup (experimental)--oom-kill-disable[=false]β Disable OOM killer-o,--overlay=[]β use an overlayFS image for persistent data storage or as read-only layer of container--passphrase[=false]β prompt for an encryption passphrase--pem-path=""β enter an path to a PEM formatted RSA key for an encrypted container-p,--pid[=false]β run container in a new PID namespace--pids-limit=0β Limit number of container PIDs, use-1for unlimited--rocm[=false]β enable experimental Rocm support--runscript-timeout=""β set the timeout duration for runscript (default1m)-S,--scratch=[]β include a scratch directory within the container that is linked to a temporary dir (use-Wto force location)--security=[]β enable security features (SELinux, Apparmor, Seccomp)--sharens[=false]β share the namespace and image with other containers launched from the same parent process--unsquash[=false]β Convert SIF file to temporary sandbox before running-u,--userns[=false]β run container in a new user namespace--uts[=false]β run container in a new UTS namespace-W,--workdir=""β working directory to be used for/tmp,/var/tmpand$HOME(if-c/--containwas also used)-w,--writable[=false]β by default all Apptainer containers are available as read only. This option makes the file system accessible as read/write.--writable-tmpfs[=false]β makes the file system accessible as read-write with non persistent data (with overlay support only)
ngl, that's a lot of flags. but you ate that. πβ¨
π§ EXAMPLE
# Here we see that the runscript prints "Hello world: "
$ apptainer exec /tmp/debian.sif cat /apptainer
#!/bin/sh
echo "Hello world: "
# It runs with our inputs when we run the image
$ apptainer 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
like, look at it. the runscript prints "Hello world: ", we run the image with one two three, and we get Hello world: one two three back. and the last one does the same thing. iconic behaviour honestly. πΈ
π₯ SEE ALSO
π HISTORY
22-Oct-2026 Auto generated by spf13/cobra
okay that's the whole page, you're basically an Apptainer run girlie now π β this masterpiece was Auto generated by spf13/cobra, dated Oct 2026, and it's the apptainer(1) manual, so go forth and run things, bestie. ππ¦
π¦ where this page comes from
- epel 9: apptainer 1.5.5-1.el9 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-LBNL AND ISC AND MIT AND MPL-2.0 AND Unlicense
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms