Ver Fonte

Merge pull request #1541 from docker/net_bridge

don't set aliasses if no network binding was declared
Ulysses Souza há 4 anos atrás
pai
commit
fb5d51f880
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      local/compose/create.go

+ 3 - 0
local/compose/create.go

@@ -850,6 +850,9 @@ func buildTmpfsOptions(tmpfs *types.ServiceVolumeTmpfs) *mount.TmpfsOptions {
 }
 }
 
 
 func buildDefaultNetworkConfig(s types.ServiceConfig, networkMode container.NetworkMode, containerName string) *network.NetworkingConfig {
 func buildDefaultNetworkConfig(s types.ServiceConfig, networkMode container.NetworkMode, containerName string) *network.NetworkingConfig {
+	if len(s.Networks) == 0 {
+		return nil
+	}
 	config := map[string]*network.EndpointSettings{}
 	config := map[string]*network.EndpointSettings{}
 	net := string(networkMode)
 	net := string(networkMode)
 	config[net] = &network.EndpointSettings{
 	config[net] = &network.EndpointSettings{