From baed11e4ff731f55918ec4163d960247be7ada04 Mon Sep 17 00:00:00 2001 From: David Trudgian Date: Thu, 31 Aug 2023 09:49:16 +0100 Subject: [PATCH] def-file: Document %post -c Fixes #171 Signed-off-by: jason yang --- definition_files.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/definition_files.rst b/definition_files.rst index 476b4890..8fd8064f 100755 --- a/definition_files.rst +++ b/definition_files.rst @@ -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 +`` argument on the ``%post`` line, e.g: + +.. code:: singularity + + %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 + `` argument must be used instead. + .. _def-test-section: %test