From 74f71a9f592b75f058fc7f97e034e2596185ea5b Mon Sep 17 00:00:00 2001 From: cytopia Date: Tue, 24 Jul 2018 08:57:34 +0200 Subject: [PATCH] #244 Connect container to Devilbox network --- .../connect-to-other-docker-container.rst | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/advanced/connect-to-other-docker-container.rst b/docs/advanced/connect-to-other-docker-container.rst index 3d368bb7..3846e695 100644 --- a/docs/advanced/connect-to-other-docker-container.rst +++ b/docs/advanced/connect-to-other-docker-container.rst @@ -35,6 +35,37 @@ Any Docker container on host os and be able to use it. +Add Docker container to Devilbox network +======================================== + +The Devilbox defines its own bridge network, usually called ``devilbox_app_net``. + +.. note:: + The name may vary depending on the name of the Devilbox directory. It assembles itself by + ``_app_net``. + +1. Start the Devilbox +2. Start your container of choice + + .. code-block:: bash + + host> docker run -d --name mycontainer + +3. Attach your container to the Devilbox network + + .. code-block:: bash + + host> docker network connect devilbox_app_net mycontainer + +Once you have done that, ``mycontainer`` is then part of the internal Devilbox network +and is able to resolve Devilbox container by its name and vice-versa. + +4. Connect from Devilbox PHP container to ``mycontainer`` + + From inside the PHP container, you can then refer to your container by its hostname + ``mycontainer`` + + Add Docker container to Devilbox stack ======================================