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
a5eb607db7
commit
67cb164880
|
@ -47,10 +47,15 @@ Sample `container.json` file:
|
|||
"MAC_ADMIN"
|
||||
],
|
||||
"network": {
|
||||
"ip": "172.17.0.100/16",
|
||||
"address": "172.17.0.100/16",
|
||||
"gateway": "172.17.42.1",
|
||||
"bridge": "docker0",
|
||||
"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
|
||||
// container to be setup with the host's networking stack
|
||||
type Network struct {
|
||||
IP string `json:"ip,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Gateway string `json:"gateway,omitempty"`
|
||||
Bridge string `json:"bridge,omitempty"`
|
||||
Mtu int `json:"mtu,omitempty"`
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"MAC_ADMIN"
|
||||
],
|
||||
"network": {
|
||||
"ip": "172.17.0.100/16",
|
||||
"address": "172.17.0.100/16",
|
||||
"gateway": "172.17.42.1",
|
||||
"bridge": "docker0",
|
||||
"mtu": 1500
|
||||
|
|
|
@ -137,7 +137,7 @@ func setupVethNetwork(config *libcontainer.Network, tempVethName string) error {
|
|||
if err := network.ChangeInterfaceName(tempVethName, "eth0"); err != nil {
|
||||
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)
|
||||
}
|
||||
if err := network.SetMtu("eth0", config.Mtu); err != nil {
|
||||
|
|
Loading…
Reference in New Issue