Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Update development docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 22, 2023
1 parent e6e679b commit 834c65a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
31 changes: 31 additions & 0 deletions static/docs/development/_sources/contents/containers.rst.txt
Expand Up @@ -204,6 +204,37 @@ If the files ``/etc/passwd`` or ``/etc/group`` were updated, there
will be an additional check to confirm if the users are in sync as
described in `Syncuser`_ section.

Excluding Files from a Container
--------------------------------

Warewulf can exclude files from a source container to prevent them
from being delivered to the compute node. This is typically used to
reduce the size of the image when some files are unnecessary.

Patterns for excluded files are read from the file
``/etc/warewulf/excludes`` in the container image itself. For example,
the default Rocky Linux images exclude these paths:

.. code-block::
/boot/
/usr/share/GeoIP
``/etc/warewulf/excludes`` supports the patterns implemented by
`filepath.Match <https://pkg.go.dev/path/filepath#Match>`_.

Preparing a container for build
-------------------------------

Warewulf executes the script ``/etc/warewulf/container_exit.sh`` after
a ``wwctl container shell`` or ``wwctl container exec`` and prior to
(re)building the final node image for delivery. This is typically used
to remove cache or log files that may have been generated by the
executed command or interactive session.

For example, the default Rocky Linux images runs ``dnf clean all`` to
remove any package repository caches that may have been generated.

Creating Containers From Scratch
================================

Expand Down
31 changes: 30 additions & 1 deletion static/docs/development/contents/containers.html
Expand Up @@ -60,7 +60,11 @@
</li>
<li class="toctree-l2"><a class="reference internal" href="#syncuser">Syncuser</a></li>
<li class="toctree-l2"><a class="reference internal" href="#listing-all-imported-containers">Listing All Imported Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#making-changes-to-containers">Making Changes To Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#making-changes-to-containers">Making Changes To Containers</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#excluding-files-from-a-container">Excluding Files from a Container</a></li>
<li class="toctree-l3"><a class="reference internal" href="#preparing-a-container-for-build">Preparing a container for build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#creating-containers-from-scratch">Creating Containers From Scratch</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#building-a-container-from-your-host">Building A Container From Your Host</a></li>
<li class="toctree-l3"><a class="reference internal" href="#building-a-container-using-apptainer">Building A Container Using Apptainer</a></li>
Expand Down Expand Up @@ -289,6 +293,31 @@ <h2>Making Changes To Containers<a class="headerlink" href="#making-changes-to-c
<p>If the files <code class="docutils literal notranslate"><span class="pre">/etc/passwd</span></code> or <code class="docutils literal notranslate"><span class="pre">/etc/group</span></code> were updated, there
will be an additional check to confirm if the users are in sync as
described in <a class="reference internal" href="#syncuser">Syncuser</a> section.</p>
<section id="excluding-files-from-a-container">
<h3>Excluding Files from a Container<a class="headerlink" href="#excluding-files-from-a-container" title="Permalink to this heading"></a></h3>
<p>Warewulf can exclude files from a source container to prevent them
from being delivered to the compute node. This is typically used to
reduce the size of the image when some files are unnecessary.</p>
<p>Patterns for excluded files are read from the file
<code class="docutils literal notranslate"><span class="pre">/etc/warewulf/excludes</span></code> in the container image itself. For example,
the default Rocky Linux images exclude these paths:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">boot</span><span class="o">/</span>
<span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">GeoIP</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">/etc/warewulf/excludes</span></code> supports the patterns implemented by
<a class="reference external" href="https://pkg.go.dev/path/filepath#Match">filepath.Match</a>.</p>
</section>
<section id="preparing-a-container-for-build">
<h3>Preparing a container for build<a class="headerlink" href="#preparing-a-container-for-build" title="Permalink to this heading"></a></h3>
<p>Warewulf executes the script <code class="docutils literal notranslate"><span class="pre">/etc/warewulf/container_exit.sh</span></code> after
a <code class="docutils literal notranslate"><span class="pre">wwctl</span> <span class="pre">container</span> <span class="pre">shell</span></code> or <code class="docutils literal notranslate"><span class="pre">wwctl</span> <span class="pre">container</span> <span class="pre">exec</span></code> and prior to
(re)building the final node image for delivery. This is typically used
to remove cache or log files that may have been generated by the
executed command or interactive session.</p>
<p>For example, the default Rocky Linux images runs <code class="docutils literal notranslate"><span class="pre">dnf</span> <span class="pre">clean</span> <span class="pre">all</span></code> to
remove any package repository caches that may have been generated.</p>
</section>
</section>
<section id="creating-containers-from-scratch">
<h2>Creating Containers From Scratch<a class="headerlink" href="#creating-containers-from-scratch" title="Permalink to this heading"></a></h2>
Expand Down
Binary file modified static/docs/development/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion static/docs/development/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 834c65a

Please sign in to comment.