Change IP to address because it includes the subnet
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
1cecb00003
commit
c4769ec624
4 changed files with 9 additions and 4 deletions
|
@ -47,10 +47,15 @@ Sample `container.json` file:
|
||||||
"MAC_ADMIN"
|
"MAC_ADMIN"
|
||||||
],
|
],
|
||||||
"network": {
|
"network": {
|
||||||
"ip": "172.17.0.100/16",
|
"address": "172.17.0.100/16",
|
||||||
"gateway": "172.17.42.1",
|
"gateway": "172.17.42.1",
|
||||||
"bridge": "docker0",
|
"bridge": "docker0",
|
||||||
"mtu": 1500
|
"mtu": 1500
|
||||||
|
},
|
||||||
|
"cgroups": {
|
||||||
|
"name": "docker-koye",
|
||||||
|
"parent": "docker",
|
||||||
|
"memory": 524800
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Container struct {
|
||||||
// The network configuration can be omited from a container causing the
|
// The network configuration can be omited from a container causing the
|
||||||
// container to be setup with the host's networking stack
|
// container to be setup with the host's networking stack
|
||||||
type Network struct {
|
type Network struct {
|
||||||
IP string `json:"ip,omitempty"`
|
Address string `json:"address,omitempty"`
|
||||||
Gateway string `json:"gateway,omitempty"`
|
Gateway string `json:"gateway,omitempty"`
|
||||||
Bridge string `json:"bridge,omitempty"`
|
Bridge string `json:"bridge,omitempty"`
|
||||||
Mtu int `json:"mtu,omitempty"`
|
Mtu int `json:"mtu,omitempty"`
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
"MAC_ADMIN"
|
"MAC_ADMIN"
|
||||||
],
|
],
|
||||||
"network": {
|
"network": {
|
||||||
"ip": "172.17.0.100/16",
|
"address": "172.17.0.100/16",
|
||||||
"gateway": "172.17.42.1",
|
"gateway": "172.17.42.1",
|
||||||
"bridge": "docker0",
|
"bridge": "docker0",
|
||||||
"mtu": 1500
|
"mtu": 1500
|
||||||
|
|
|
@ -137,7 +137,7 @@ func setupVethNetwork(config *libcontainer.Network, tempVethName string) error {
|
||||||
if err := network.ChangeInterfaceName(tempVethName, "eth0"); err != nil {
|
if err := network.ChangeInterfaceName(tempVethName, "eth0"); err != nil {
|
||||||
return fmt.Errorf("change %s to eth0 %s", tempVethName, err)
|
return fmt.Errorf("change %s to eth0 %s", tempVethName, err)
|
||||||
}
|
}
|
||||||
if err := network.SetInterfaceIp("eth0", config.IP); err != nil {
|
if err := network.SetInterfaceIp("eth0", config.Address); err != nil {
|
||||||
return fmt.Errorf("set eth0 ip %s", err)
|
return fmt.Errorf("set eth0 ip %s", err)
|
||||||
}
|
}
|
||||||
if err := network.SetMtu("eth0", config.Mtu); err != nil {
|
if err := network.SetMtu("eth0", config.Mtu); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue