From 3c5e73de1c48b34b49036921976846891746abfe Mon Sep 17 00:00:00 2001 From: jason yang Date: Thu, 13 Feb 2025 11:22:52 +0900 Subject: [PATCH] add multiple env-file Signed-off-by: jason yang --- environment_and_metadata.rst | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/environment_and_metadata.rst b/environment_and_metadata.rst index 34608037..5bc5aff8 100644 --- a/environment_and_metadata.rst +++ b/environment_and_metadata.rst @@ -273,7 +273,7 @@ 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:: @@ -281,9 +281,20 @@ environment variables as ``NAME=VALUE`` pairs, e.g.: $ 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 ==========================