Skip to content

Commit

Permalink
building_images: Added bit more info on environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
simo-tuomisto committed Apr 30, 2024
1 parent b4ab389 commit 6676ff5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions content/building_images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ After re-building the image we can test the numpy installation with:
Anybody who has access to the image can access all files
in the image.


Setting environment variables in the image
------------------------------------------

Expand Down Expand Up @@ -282,6 +283,15 @@ After re-building the image we can test that the environment values is set with:
$ apptainer exec my_container.sif python -c 'import os; print(os.getenv("MYVAR"))'
yes
You can also set environment variables when running an image by
setting ``APPTAINERENV_MYVAR=myvalue`` outside of the container or
by giving ``--env MYVAR=myvalue`` as a flag to the
``run``/``exec``/``shell``-command.

For more info on how to set environment variables when running containers,
see `this page <https://apptainer.org/docs/user/latest/environment_and_metadata.html>`__
from Apptainer's documentation.


Adding documentation to your image
----------------------------------
Expand Down

0 comments on commit 6676ff5

Please sign in to comment.