<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.anunna.wur.nl/index.php?action=history&amp;feed=atom&amp;title=Tutorials%2FApptainer-PullingImages</id>
	<title>Tutorials/Apptainer-PullingImages - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anunna.wur.nl/index.php?action=history&amp;feed=atom&amp;title=Tutorials%2FApptainer-PullingImages"/>
	<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tutorials/Apptainer-PullingImages&amp;action=history"/>
	<updated>2026-05-14T07:29:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tutorials/Apptainer-PullingImages&amp;diff=2677&amp;oldid=prev</id>
		<title>Honfi001 at 09:11, 12 March 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tutorials/Apptainer-PullingImages&amp;diff=2677&amp;oldid=prev"/>
		<updated>2026-03-12T09:11:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:11, 12 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Getting Started ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Getting Started ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First, make sure your module environment is clean and Apptainer is loaded:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;grab an interactive session in a  compute node.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Then &lt;/ins&gt;make sure your module environment is clean and Apptainer is loaded:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Honfi001</name></author>
	</entry>
	<entry>
		<id>https://wiki.anunna.wur.nl/index.php?title=Tutorials/Apptainer-PullingImages&amp;diff=2676&amp;oldid=prev</id>
		<title>Honfi001: Add message about storing image in lustre</title>
		<link rel="alternate" type="text/html" href="https://wiki.anunna.wur.nl/index.php?title=Tutorials/Apptainer-PullingImages&amp;diff=2676&amp;oldid=prev"/>
		<updated>2026-03-12T09:09:41Z</updated>

		<summary type="html">&lt;p&gt;Add message about storing image in lustre&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Pulling Apptainer Images =&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
First, make sure your module environment is clean and Apptainer is loaded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module reset&lt;br /&gt;
module load utilities Apptainer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Also, please make sure to store image and in your lustre folders. &lt;br /&gt;
&lt;br /&gt;
== Your First Pull ==&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s start by pulling a simple &amp;quot;hello world&amp;quot; container image:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer pull ./hello-world.sif shub://vsoch/hello-world&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is a lot happening in one line, so let&amp;#039;s break it down piece by piece:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Part !! What it means&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;apptainer pull&amp;lt;/code&amp;gt; || The Apptainer command to download a container image.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;./hello-world.sif&amp;lt;/code&amp;gt; || The output filename. This is where Apptainer will save the downloaded image. The &amp;lt;code&amp;gt;.sif&amp;lt;/code&amp;gt; extension stands for &amp;#039;&amp;#039;&amp;#039;Singularity Image Format&amp;#039;&amp;#039;&amp;#039; — Apptainer&amp;#039;s own container format. The &amp;lt;code&amp;gt;./&amp;lt;/code&amp;gt; means &amp;quot;save it in my current directory&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;shub://vsoch/hello-world&amp;lt;/code&amp;gt; || The source to pull from. &amp;lt;code&amp;gt;shub://&amp;lt;/code&amp;gt; tells Apptainer to look at [https://singularity-hub.org Singularity Hub], a public registry for container images. &amp;lt;code&amp;gt;vsoch/hello-world&amp;lt;/code&amp;gt; is the user and image name, much like a path on GitHub.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the command finishes, you will have a file called &amp;lt;code&amp;gt;hello-world.sif&amp;lt;/code&amp;gt; in your current directory. You can verify this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lh hello-world.sif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This &amp;lt;code&amp;gt;.sif&amp;lt;/code&amp;gt; file is your container — a single, portable file that contains an entire operating system and software environment. You can copy it, move it, or share it just like any other file.&lt;br /&gt;
&lt;br /&gt;
== Running the Container ==&lt;br /&gt;
&lt;br /&gt;
The simplest way to use a container is with &amp;lt;code&amp;gt;apptainer run&amp;lt;/code&amp;gt;. This executes whatever default action the container was built to perform:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer run ./hello-world.sif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see a friendly output from the container. That is it — you just ran software inside a container.&lt;br /&gt;
&lt;br /&gt;
== Opening a Shell Inside the Container ==&lt;br /&gt;
&lt;br /&gt;
Instead of running the container&amp;#039;s default action, you can open an interactive shell inside it. This lets you look around and explore the container&amp;#039;s environment as if you had logged into a different machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer shell ./hello-world.sif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice your prompt changes (usually to &amp;lt;code&amp;gt;Apptainer&amp;gt;&amp;lt;/code&amp;gt;), indicating that you are now &amp;quot;inside&amp;quot; the container. Type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; when you want to leave.&lt;br /&gt;
&lt;br /&gt;
=== The Container is Not Fully Isolated (by Default) ===&lt;br /&gt;
&lt;br /&gt;
Here is something important that surprises many beginners: by default, Apptainer does &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; fully isolate the container from the host system. Your home directory and parts of the host filesystem are still visible inside the container.&lt;br /&gt;
&lt;br /&gt;
Try this while inside the shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer shell ./hello-world.sif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, from inside the container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Apptainer&amp;gt; mkdir ~/test-from-container&lt;br /&gt;
Apptainer&amp;gt; ls ~/test-from-container&lt;br /&gt;
Apptainer&amp;gt; exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, back on the host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls ~/test-from-container&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The directory is there — on your &amp;#039;&amp;#039;&amp;#039;real&amp;#039;&amp;#039;&amp;#039; filesystem. The container was able to create it because your home directory was mounted inside the container by default. This is by design: it makes it easy to work with your own files, but it means the container is not completely separate from the host.&lt;br /&gt;
&lt;br /&gt;
=== Full Isolation with &amp;lt;code&amp;gt;--containall&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
If you want the container to be fully isolated from the host system — no access to your home directory, no shared environment variables, no host filesystems — use the &amp;lt;code&amp;gt;--containall&amp;lt;/code&amp;gt; flag (or its short form &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer shell --containall ./hello-world.sif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now try the same thing from inside:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Apptainer&amp;gt; mkdir ~/test-isolated&lt;br /&gt;
Apptainer&amp;gt; exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on the host:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls ~/test-isolated&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, the directory does &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; exist on your host. The container was completely isolated — anything it created lived only inside the container&amp;#039;s temporary environment and was discarded when you exited.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;--containall&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt;) when you want a clean, reproducible environment that does not interfere with (or depend on) the host system.&lt;br /&gt;
&lt;br /&gt;
== Running a Specific Command with &amp;lt;code&amp;gt;exec&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
Sometimes you do not want a full interactive shell — you just want to run a single command inside the container and get the output. That is what &amp;lt;code&amp;gt;apptainer exec&amp;lt;/code&amp;gt; is for.&lt;br /&gt;
&lt;br /&gt;
For example, let&amp;#039;s check which operating system is inside this container:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apptainer exec ./hello-world.sif cat /etc/lsb-release&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
DISTRIB_ID=Ubuntu&lt;br /&gt;
DISTRIB_RELEASE=14.04&lt;br /&gt;
DISTRIB_CODENAME=trusty&lt;br /&gt;
DISTRIB_DESCRIPTION=&amp;quot;Ubuntu 14.04.6 LTS&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The container is running &amp;#039;&amp;#039;&amp;#039;Ubuntu 14.04&amp;#039;&amp;#039;&amp;#039; — regardless of what operating system your host machine is running. This is the power of containers: you can run software built for a completely different OS environment without any conflicts.&lt;br /&gt;
&lt;br /&gt;
The pattern for &amp;lt;code&amp;gt;exec&amp;lt;/code&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apptainer exec &amp;#039;&amp;#039;[options]&amp;#039;&amp;#039; &amp;#039;&amp;#039;container.sif&amp;#039;&amp;#039; &amp;#039;&amp;#039;command&amp;#039;&amp;#039; &amp;#039;&amp;#039;[arguments]&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
You now know the three main ways to interact with a pulled Apptainer container:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command !! What it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;apptainer run container.sif&amp;lt;/code&amp;gt; || Runs the container&amp;#039;s default action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;apptainer shell container.sif&amp;lt;/code&amp;gt; || Opens an interactive shell inside the container&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;apptainer exec container.sif &amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; || Runs a single specific command inside the container&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
And one important flag to remember:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Flag !! What it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--containall&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt;) || Fully isolates the container from the host (no shared home directory, no host environment)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Honfi001</name></author>
	</entry>
</feed>