diff options
author | ChristopherHX <christopher.homberger@web.de> | 2023-11-12 19:09:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-12 19:09:25 +0100 |
commit | 74b0fe8ba9c04cbf3d55f6536249d959599ed676 (patch) | |
tree | d4e6cb1a4fb250714fb09426086b5cb1c47a2da0 /pkg | |
parent | Don't set GITHUB_TOKEN (#2089) (diff) | |
download | forgejo-act-74b0fe8ba9c04cbf3d55f6536249d959599ed676.tar.xz forgejo-act-74b0fe8ba9c04cbf3d55f6536249d959599ed676.zip |
fix: (#2075)
network-scoped alias is supported only for containers in user defined networks
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/container/docker_run.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/container/docker_run.go b/pkg/container/docker_run.go index f5a898e..5a8afa2 100644 --- a/pkg/container/docker_run.go +++ b/pkg/container/docker_run.go @@ -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, } |