From 334e362d91c82cf050c6176c9df45435fc8d0967 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 14 Apr 2021 14:03:59 +0200 Subject: [PATCH] don't set aliasses if no network binding was declared Signed-off-by: Nicolas De Loof --- local/compose/create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/local/compose/create.go b/local/compose/create.go index 311fe83c0..e4d297f07 100644 --- a/local/compose/create.go +++ b/local/compose/create.go @@ -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{