From dead8eac3d1ce78977b712ef7795a11dadb960c0 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 11 Aug 2018 11:14:34 +0200 Subject: [PATCH] Fixes #255 - Document SELinux labels for mount options --- docs/_includes/links/docker.rst | 23 +++++++++++++ docs/configuration-files/env-file.rst | 34 +++++++++++++++++++ docs/getting-started/install-the-devilbox.rst | 24 +++++++++++++ 3 files changed, 81 insertions(+) diff --git a/docs/_includes/links/docker.rst b/docs/_includes/links/docker.rst index 7df46954..c4d8a882 100644 --- a/docs/_includes/links/docker.rst +++ b/docs/_includes/links/docker.rst @@ -115,3 +115,26 @@ Docker Toolbox on Windows: add shared directories + +.. + ============================================================ + Docker Documention + ============================================================ + +.. |ext_lnk_docker_bind_propagation| raw:: html + + + Docker: Configure bind propagation + + +.. |ext_lnk_docker_selinux_label| raw:: html + + + Docker: Configure the selinux label + + +.. |ext_lnk_docker_mount_z_flag| raw:: html + + + Stackoverflow: What is the z flag + diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index 65e6c72b..460d5a0b 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -787,6 +787,40 @@ downloading libraries with ``composer`` and others. Being able to do that on both sides, removes the need to install any development tools (except your IDE/editor) on your host and have everything fully encapsulated into the containers itself. +.. _env_mount_options: + +MOUNT_OPTIONS +------------- + +This variable allows you to add custom mount options/flags to all mounted directories. +Initially only ``rw`` or ``ro`` are applied to mount points, you can however extend this +before starting up the Devilbox. + + ++------------------------------+--------------------+----------------+ +| Name | Allowed values | Default value | ++==============================+====================+================+ +| ``MOUNT_OPTIONS`` | valid mount option | empty | ++------------------------------+--------------------+----------------+ + +If you are on Linux with SELinux enabled, you will want to set this value to ``,z`` to modify +SELinux labels in order to share mounts among multiple container. + +.. seealso:: + * |ext_lnk_docker_bind_propagation| + * |ext_lnk_docker_selinux_label| + * |ext_lnk_docker_mount_z_flag| + +.. important:: + When adding custom mount options, ensure to start with a leading ``,``, as those options + are prepended to already existing options. + + .. code-block:: bash + + MOUNT_OPTIONS=,z + MOUNT_OPTIONS=,cached + + .. _env_httpd_datadir: diff --git a/docs/getting-started/install-the-devilbox.rst b/docs/getting-started/install-the-devilbox.rst index e8a71aa2..72b48135 100644 --- a/docs/getting-started/install-the-devilbox.rst +++ b/docs/getting-started/install-the-devilbox.rst @@ -99,6 +99,30 @@ Open the ``.env`` file with your favorite text editor and adjust those values: * :ref:`syncronize_container_permissions` +OS specific setup +================= + +Linux: SELinux +-------------- + +If you have SELinux enabled, you will also have to adjust the :ref:`env_mount_options` to allow +shared mounts among multiple container: + +.. code-block:: bash + :caption: .env + :emphasize-lines: 3 + + host> vi .env + + MOUNT_OPTIONS=,z + +.. seealso:: + * https://github.com/cytopia/devilbox/issues/255 + * :ref:`env_mount_options` + * |ext_lnk_docker_selinux_label| + * |ext_lnk_docker_mount_z_flag| + + Checklist =========