Running Containers
Ben Trumbore, Steve Lantz, and Zilu Wang
Cornell Center for Advanced Computing
8/2026 (original)
This topic introduces the various methods for running a container, including how to control the visibility of host directories inside the container, bind host directories to container paths, and manage containers running in the background. It also explores the environment variables that are present in the container, and what is and isn't preserved after the container exits.
Objectives
After you complete this topic, you should be able to:
- Use the Apptainer command-line interface
- Run a container using
apptainer run,apptainer exec, andapptainer shell - Execute commands that run inside an Apptainer container
- Name the host directories that are mounted inside a container by default
- Limit access to host directories from a container using the
-C,--no-home, and--no-mountoptions - Bind addtional host directories to containers using the
--bindoption - Configure environment variables for shells that run in the container
- Start, list, and stop containers running in the background
Prerequisites
This topic covers basic information on containers and Apptainer usage through the command line interface. Some familiarity with Linux is preferred, but it is not necessary.
©
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)