community man page

apptainer-exec

GNU

Execute a command within an Apptainer container. See also: `apptainer run`, `apptainer shell`.

8 examples·source: tldr · CC-BY·status: verified
Reading is open to everyone. Suggesting a flag, fixing an example or adding a recipe is opening to verified-email accounts soon — every change is moderated before it goes live.
curl https://curlhub.sh/man/apptainer-exec
same page, in your terminal

Examples

Execute a command inside a container GNU

apptainer exec path/to/image.sif command

Execute a command with arguments GNU

apptainer exec path/to/image.sif command arg1 arg2 ...

Execute a command with a bind mount from host to container GNU

apptainer exec [-B|--bind] path/to/source:path/to/destination path/to/image.sif command

Execute a command with environment variables GNU

apptainer exec --env variable=value path/to/image.sif command

Execute a command in fully isolated mode (contained filesystem, PID, IPC, and clean environment) GNU

apptainer exec [-C|--containall] path/to/image.sif command

Execute a command with a writable temporary filesystem overlay GNU

apptainer exec --writable-tmpfs path/to/image.sif command

Execute a command with NVIDIA GPU support GNU

apptainer exec --nv path/to/image.sif command

Display help GNU

apptainer exec [-h|--help]