Skip to content

Commit

Permalink
Merge pull request #322 from JasonYangShadow/issue/313
Browse files Browse the repository at this point in the history
Document support for multiple env-file
  • Loading branch information
DrDaveD authored Feb 13, 2025
2 parents 57f491d + 3c5e73d commit 0a62165
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions environment_and_metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,28 @@ variables include special characters.
``--env-file`` option
=====================

The ``--env-file`` option lets you provide a file that contains
The ``--env-file`` option lets you provide one or more files that contain
environment variables as ``NAME=VALUE`` pairs, e.g.:

.. code::
$ cat myenvs
MYVAR="Hello from a file"
$ {command} run --env-file myenvs env.sif
$ cat myenvs2
MYVAR="Hello from a file 2"
$ {command} run --env-file myenvs --env-file myenvs2 env.sif
Hello from a file 2
$ {command} run --env-file myenvs2,myenvs env.sif
Hello from a file
.. note::

Note that if more than one file is used, the variables of the same name are
overridden with later files taking priority.

``{ENVPREFIX}ENV_`` prefix
==========================

Expand Down

0 comments on commit 0a62165

Please sign in to comment.