moby: enable internet access for GCP VM's

Adds an "access config" with a type of "ONE_TO_ONE_NAT" that
allows an instance to obtain an ephemeral IP address and access the
internet

Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
Dave Tucker 2017-04-11 23:36:31 +01:00
parent f47bc385c6
commit 90ed2469db

View File

@ -211,6 +211,11 @@ func (g GCPClient) CreateInstance(name, image, zone, machineType string, replace
NetworkInterfaces: []*compute.NetworkInterface{
{
Network: "global/networks/default",
AccessConfigs: []*compute.AccessConfig{
{
Type: "ONE_TO_ONE_NAT",
},
},
},
},
Metadata: &compute.Metadata{