Browse Source

Add volume documentation.

develop
Sam Black 4 years ago
parent
commit
5ee1e502b8
  1. 14
      docs/config/image.rst
  2. 7
      docs/usage/container.rst

14
docs/config/image.rst

@ -484,3 +484,17 @@ allowing the image directory structure to be preserved;
this would be useful for application paths that
use directories to store runtime state,
such as ``/var/lib/nginx`` for ``nginx``.
Volumes: ``volumes``
====================
Paths in the image that should be mounted read write into the container
from user defined directories.
This is used for read-only containers to
write out data that should be persisted, such as ``postgres`` data.
If a volume is not defined during container creation,
``sponson`` creates a directory for the volume
to ensure the container works as expected.

7
docs/usage/container.rst

@ -31,7 +31,7 @@ new
.. code::
sponson container new [--version <image version>] [--readwrite] <image name> <new container name>
sponson container new [--version <image version>] [--volume <volume name>:<volume source path>]* [--readwrite] <image name> <new container name>
Create a new container based on the provided image name.
@ -41,6 +41,11 @@ The container name must be unique.
The latest version of the image is used as a base for the container,
unless ``--version`` provides a specific version.
Volumes can be defined for this container using the ``--volume`` option.
The argument should be of the form ``<volume name>:<volume source path>``.
``--volume`` can be defined multiple times for each volume in the container.
Containers are by default read-only,
however if ``--readwrite`` is specified the container is writable,
and any changes made by the container are stored in

Loading…
Cancel
Save