Apptainer/en: Difference between revisions

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 66: Line 66:
==Important command line options==
==Important command line options==


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:
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"
Line 251: Line 251:
==Overview==
==Overview==


<b>NOTE:</b> Please note and heed the advice concerning building images/overlays given <b>[[#Building_Images.2FOverlays|earlier on this page]]</b> .
<b>NOTE:</b> Please note and heed the advice concerning building images/overlays given in section <b>[[#Building_images_or_overlays|Building images and overlays]]</b>.


Apptainer "images" can be created in the following formats:
Apptainer "images" can be created in the following formats:
Line 283: Line 283:
==Building a SIF image==
==Building a SIF image==


<b>NOTE:</b>  Please note and heed the advice concerning building images/overlays given <b> [[#Building_Images.2FOverlays|earlier on this page]]</b> .
<b>NOTE:</b>  Please note and heed the advice concerning building images/overlays in section <b>[[#Building_Images.2FOverlays|Building images and overlays]] </b> above.


To build an Apptainer SIF file image from Docker's latest available busybox image, use the <code>apptainer build</code> command:
To build an Apptainer SIF file image from Docker's latest available busybox image, use the <code>apptainer build</code> command:
Line 292: Line 292:
==Building a sandbox image==
==Building a sandbox image==


<b>NOTE:</b>  Please note and heed the advice concerning building images/overlays given <b>[[#Building_Images.2FOverlays|earlier on this page]]</b> .
<b>NOTE:</b>  Please note and heed the advice concerning building images/overlays in section <b>[[#Building_Images.2FOverlays|Building images and overlays]] </b> above.


In order to build a "sandbox" directory instead of an <code>SIF</code> file instead of providing an <code>SIF</code> file name, instead provide <code>--sandbox DIR_NAME</code> or <code>-s DIR_NAME</code> where <code>DIR_NAME</code> is the name of the to-be-created-directory where you want your "sandbox" image. For example, if the <code>apptainer build</code> command to create an <code>SIF</code> file was:
In order to build a "sandbox" directory instead of an <code>SIF</code> file instead of providing an <code>SIF</code> file name, instead provide <code>--sandbox DIR_NAME</code> or <code>-s DIR_NAME</code> where <code>DIR_NAME</code> is the name of the to-be-created-directory where you want your "sandbox" image. For example, if the <code>apptainer build</code> command to create an <code>SIF</code> file was:
38,760

edits