Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 8, 2024
1 parent ce62197 commit 9bb745d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/user/main/_sources/definition_files.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,25 @@ container at runtime.
``${ENVPREFIX}_ENVIRONMENT`` take precedence over those added via
``%environment``.

The ``%post`` scriptlet will run under ``sh`` or ``bash`` by default. You can
change the shell or interpreter that the scriptlet runs under by using a ``-c
<shell>`` argument on the ``%post`` line, e.g:

.. code:: {command}

%post -c /bin/zsh
...

In the ``%post`` section above, the scriptlet will be run by the zsh shell
installed at ``/bin/zsh`` in the container. The requested shell must be present
in the base image that was bootstrapped.

.. note::

Unlike the ``%test`` and ``%runscript`` sections, the ``%post`` section does
not support hashbang lines (``#!``) for specifying a custom shell. The ``-c
<shell>`` argument must be used instead.

.. _def-test-section:

%test
Expand Down
16 changes: 16 additions & 0 deletions docs/user/main/definition_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,22 @@ <h3>%post<a class="headerlink" href="#post" title="Permalink to this heading">
<code class="docutils literal notranslate"><span class="pre">$APPTAINER_ENVIRONMENT</span></code> take precedence over those added via
<code class="docutils literal notranslate"><span class="pre">%environment</span></code>.</p>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">%post</span></code> scriptlet will run under <code class="docutils literal notranslate"><span class="pre">sh</span></code> or <code class="docutils literal notranslate"><span class="pre">bash</span></code> by default. You can
change the shell or interpreter that the scriptlet runs under by using a <code class="docutils literal notranslate"><span class="pre">-c</span>
<span class="pre">&lt;shell&gt;</span></code> argument on the <code class="docutils literal notranslate"><span class="pre">%post</span></code> line, e.g:</p>
<div class="highlight-apptainer notranslate"><div class="highlight"><pre><span></span><span class="gh">%post</span><span class="w"> </span>-c<span class="w"> </span>/bin/zsh
<span class="w"> </span>...
</pre></div>
</div>
<p>In the <code class="docutils literal notranslate"><span class="pre">%post</span></code> section above, the scriptlet will be run by the zsh shell
installed at <code class="docutils literal notranslate"><span class="pre">/bin/zsh</span></code> in the container. The requested shell must be present
in the base image that was bootstrapped.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Unlike the <code class="docutils literal notranslate"><span class="pre">%test</span></code> and <code class="docutils literal notranslate"><span class="pre">%runscript</span></code> sections, the <code class="docutils literal notranslate"><span class="pre">%post</span></code> section does
not support hashbang lines (<code class="docutils literal notranslate"><span class="pre">#!</span></code>) for specifying a custom shell. The <code class="docutils literal notranslate"><span class="pre">-c</span>
<span class="pre">&lt;shell&gt;</span></code> argument must be used instead.</p>
</div>
</div>
<div class="section" id="test">
<span id="def-test-section"></span><h3>%test<a class="headerlink" href="#test" title="Permalink to this heading"></a></h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/user/main/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 9bb745d

Please sign in to comment.