Skip to content

Commit

Permalink
fix: (#2075)
Browse files Browse the repository at this point in the history
network-scoped alias is supported only for containers in user defined networks

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
ChristopherHX and mergify[bot] committed Nov 12, 2023
1 parent 18b4714 commit 74b0fe8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/container/docker_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E

var networkingConfig *network.NetworkingConfig
logger.Debugf("input.NetworkAliases ==> %v", input.NetworkAliases)
if hostConfig.NetworkMode.IsUserDefined() && len(input.NetworkAliases) > 0 {
n := hostConfig.NetworkMode
// TODO: use IsUserDefined() once it's windows implementation matches the unix one
if !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() && len(input.NetworkAliases) > 0 {
endpointConfig := &network.EndpointSettings{
Aliases: input.NetworkAliases,
}
Expand Down

0 comments on commit 74b0fe8

Please sign in to comment.