Apptainer/en: Difference between revisions

Jump to navigation Jump to search
Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 34: Line 34:
* [https://www.docker.com/ Docker]
* [https://www.docker.com/ Docker]
** Using Docker on a multiuser cluster creates security risks, therefore we do not make Docker available on our HPC clusters.
** Using Docker on a multiuser cluster creates security risks, therefore we do not make Docker available on our HPC clusters.
** You can install and use Docker on your own computer and use it to create an Apptainer image, which can then be uploaded to an HPC cluster as outlined in <b>[[#Creating_an_Apptainer_Container_From_a_Dockerfile|this section]]</b> later on this page.
** You can install and use Docker on your own computer and use it to create an Apptainer image, which can then be uploaded to an HPC cluster as outlined in <b>[[#Creating_an_Apptainer_container_from_a_Dockerfile|this section]]</b> later on this page.


==Other items==
==Other items==
===General===
===General===
* In order to use Apptainer you must have a container <b>image</b>, e.g., a <code>.sif</code> file or a "sandbox" directory created previously. If you don't already have an image or a sandbox, see the section on <b>[[#Building_an_Apptainer_Container/Image|building an image]]</b> below.
* In order to use Apptainer you must have a container <b>image</b>, e.g., a <code>.sif</code> file or a "sandbox" directory created previously. If you don't already have an image or a sandbox, see the section on <b>[[#Building_an_Apptainer_container/image|building an image]]</b> below.
* While Apptainer is installed and available for use, using Apptainer will require you to install and/or build all software you will need to make use of in your container. In many instances, <b>[[Available_software|we already have such software installed on our clusters]]</b> so there is often no need to create a container with the same installed in it.
* While Apptainer is installed and available for use, using Apptainer will require you to install and/or build all software you will need to make use of in your container. In many instances, <b>[[Available_software|we already have such software installed on our clusters]]</b> so there is often no need to create a container with the same installed in it.


Line 66: Line 66:
==Important command line options==
==Important command line options==


Software that is run inside a container runs in a different environment using different libraries and tools than what is installed on the host system. It is, therefore, important to run programs within containers by <b>not</b> using any environment settings or software defined outside of the container. Unfortunately, by default, Apptainer will run adopting the shell environment of the host and this can result in issues when running programs. To avoid such issues, when using <code>apptainer run</code>, <code>apptainer shell</code>, <code>apptainer exec</code>, and/or </code>apptainer instance</code>, use one of these options (with more preference to those options listed earlier in the table below):
Software that is run inside a container is in an environment that uses different libraries and tools than what is installed on the host system. It is, therefore, important to run programs within containers by <b>not</b> using any environment settings or software defined outside of the container. Unfortunately, by default, Apptainer will run adopting the shell environment of the host and this can result in issues when running programs. To avoid such issues, when using <code>apptainer run</code>, <code>apptainer shell</code>, <code>apptainer exec</code>, and/or <code>apptainer instance</code>, use one of these options:


{| class="wikitable"
{| class="wikitable"
|+Apptainer Environment Command Line Options
|+Apptainer Environment Command Line Options
|-
 
! scope="col" |Option !! scope="col" | Description
|-
|-
| <code>-C</code> || Isolates the running container from all file systems as well as the parent PID, IPC, and environment. Using this option will require [[#Bind_Mounts|using bind mounts]] if access to filesystems outside of the container is needed.
| <code>-C</code> || Isolates the running container from all file systems as well as the parent PID, IPC, and environment. Using this option will require [[#Bind_Mounts|using bind mounts]] if access to filesystems outside of the container is needed.
38,760

edits

Navigation menu