Merge pull request #132 from mavenugo/stack-host

Host and Bridge network support in docker stack deploy
This commit is contained in:
Vincent Demeester
2017-05-31 15:07:56 -07:00
committed by GitHub
5 changed files with 136 additions and 21 deletions

View File

@ -223,10 +223,16 @@ func convertServiceNetworks(
if networkConfig.External.External {
target = networkConfig.External.Name
}
nets = append(nets, swarm.NetworkAttachmentConfig{
netAttachConfig := swarm.NetworkAttachmentConfig{
Target: target,
Aliases: append(aliases, name),
})
Aliases: aliases,
}
// Only add default aliases to user defined networks. Other networks do
// not support aliases.
if container.NetworkMode(target).IsUserDefined() {
netAttachConfig.Aliases = append(netAttachConfig.Aliases, name)
}
nets = append(nets, netAttachConfig)
}
sort.Sort(byNetworkTarget(nets))