mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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
c442586305
commit
3cb698125d
4 changed files with 9 additions and 4 deletions
|
@ -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 a new issue