From 2c25cf8d019fd12f16b9888cce1a9702075b4c0c Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 5 Mar 2019 13:46:05 -0800 Subject: [PATCH] Add note about network creation in docker provider --- website/source/docs/docker/networking.html.md | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/website/source/docs/docker/networking.html.md b/website/source/docs/docker/networking.html.md index b2eddfdfc..0f3b4b295 100644 --- a/website/source/docs/docker/networking.html.md +++ b/website/source/docs/docker/networking.html.md @@ -16,9 +16,23 @@ by the subnet used for a requested ip address. For each newly unique network, Vagrant will run the `docker network create` subcommand with the provided options from the network config inside your Vagrantfile. If multiple -networks share the same subnet, it will reuse that existing network. Once these -networks have been created, Vagrant will attach these networks to the requested -containers using the `docker network connect` for each network. +networks share the same subnet, Vagrant will reuse that existing network for multiple +containers. Once these networks have been created, Vagrant will attach these +networks to the requested containers using the `docker network connect` for each +network. + +Vagrant names the networks inside docker as `vagrant_network` or `vagrant_network_` +where `` is the subnet for the network if defined by the user. An +example of these networks is shown later in this page. If no subnet is requested +for the network, Vagrant will connect the `vagrant_network` to the container. + +When destroying containers through Vagrant, Vagrant will clean up the network if +there are no more containers using the network. + +## Docker Network Options + +Only the network option `:private_network` is currently supported with the docker +provider in Vagrant. Most of the options given to `:private_network` align with the command line flags for the [docker network create](https://docs.docker.com/engine/reference/commandline/network_create/) @@ -30,9 +44,6 @@ option should use `ip6` rather than `ip`. If you just want to use DHCP, you can simply say `type: "dhcp"` insetad. More examples are shared below which demonstrate creating a few common network interfaces. -When destroying containers through Vagrant, Vagrant will clean up the network if -there are no more containers using the network. - ## Docker Network Example The following Vagrantfile will generate these networks for a container: