Explorar o código

don't set aliasses if no network binding was declared

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof %!s(int64=4) %!d(string=hai) anos
pai
achega
334e362d91
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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 {
+	if len(s.Networks) == 0 {
+		return nil
+	}
 	config := map[string]*network.EndpointSettings{}
 	net := string(networkMode)
 	config[net] = &network.EndpointSettings{