fix: 解决容器设置 host 网络失败的问题 (#2582)

Refs #2550
pull/2587/head
ssongliu 1 year ago committed by GitHub
parent 3ff09c8b7a
commit 0f7ec06404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -867,6 +867,10 @@ func loadConfigInfo(isCreate bool, req dto.ContainerOperate, oldContainer *types
config.Tty = req.Tty
if len(req.Network) != 0 {
switch req.Network {
case "host", "none", "bridge":
hostConf.NetworkMode = container.NetworkMode(req.Network)
}
networkConf.EndpointsConfig = map[string]*network.EndpointSettings{req.Network: {}}
} else {
networkConf = network.NetworkingConfig{}

Loading…
Cancel
Save