mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-15 14:46:41 +00:00
#244 Connect container to Devilbox network
This commit is contained in:
parent
775180af8b
commit
74f71a9f59
@ -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
|
||||
``<Devilbox_dir_name>_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
|
||||
======================================
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user