Skip to content

Commit

Permalink
docs: Correct docs regarding the use of env vars in volumes
Browse files Browse the repository at this point in the history
Environment variables can be used in either the key (the container path)
*or* in the host path, as shown in the accompanying example.

See also this test:
https://github.com/JonathonReinhart/scuba/blob/c6f3e62570/tests/test_config.py#L986

Also, move the existing note to a note:: admonition, and indicate that
unset variables will cause a config error.
  • Loading branch information
JonathonReinhart committed Sep 7, 2023
1 parent c6f3e62 commit d16b50d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,28 @@ of volume options:
hostpath: /host/foo
options: ro,cached
The keys used in volume mappings can contain environment variables **that are
expanded in the host environment**. For example, this configuration would map
the user's ``/home/username/.config/application1`` directory into the container
at the same path.
The paths (host or container) used in volume mappings can contain environment
variables **which are expanded in the host environment**. For example, this
configuration would map the user's ``/home/username/.config/application1``
directory into the container at the same path.

.. code-block:: yaml
volumes:
$TEST_HOME/.config/application1: $TEST_HOME/.config/application1
Note that because variable expansion is now applied to all volume keys, if one
desires to have a key with an explicit ``$`` character, it must be written as
``$$``.
If a referenced environment variable is not set, Scuba exits with a
configuration error.

Volume host directories which do not already exist are created as the current
user before creating the container.

.. note::
Because variable expansion is now applied to all volume paths, if one
desires to use a literal ``$`` character in a path, it must be written as
``$$``.


.. _conf_aliases:

``aliases``
Expand Down

0 comments on commit d16b50d

Please sign in to comment.