diff options
| author | Aanand Prasad <aanand.prasad@gmail.com> | 2016-01-05 12:55:45 +0000 |
|---|---|---|
| committer | Aanand Prasad <aanand.prasad@gmail.com> | 2016-01-05 12:55:45 +0000 |
| commit | 62d9964cc1881f6f3cd021594cd40fd80a8fc855 (patch) | |
| tree | 3e26ffbbe67582f2eb5f5cc36075eeefa82e08b6 /docs | |
| parent | 140879d65720646b87fe7a8809a8f2a7846ade39 (diff) | |
| parent | 67a29441c4605c4027fa22484f3d14f36349c6bb (diff) | |
| download | docker-py-62d9964cc1881f6f3cd021594cd40fd80a8fc855.tar.gz | |
Merge pull request #818 from rmb938/patch-1
allow custom ipam options when creating networks
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/networks.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/networks.md b/docs/networks.md new file mode 100644 index 0000000..4193537 --- /dev/null +++ b/docs/networks.md @@ -0,0 +1,20 @@ +# Using Networks + +With the release of Docker 1.9 you can now manage custom networks. + + +Here you can see how to create a network named ```network1``` using the ```bridge``` driver + +```python +docker_client.create_network("network1", driver="bridge") +``` + +You can also create more advanced networks with custom IPAM configurations. For example, +setting the subnet to ```192.168.52.0/24``` and gateway to ```192.168.52.254``` + +```python + +ipam_config = docker.utils.create_ipam_config(subnet='192.168.52.0/24', gateway='192.168.52.254') + +docker_client.create_network("network1", driver="bridge", ipam=ipam_config) +``` |
