Merge pull request #1541 from docker/net_bridge

don't set aliasses if no network binding was declared
This commit is contained in:
Ulysses Souza 2021-04-15 15:27:21 -03:00 committed by GitHub
commit fb5d51f880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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{