From 16914e372eaef9a1cf04c08615881d59eba18358 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Tue, 1 Mar 2022 11:44:51 +0100 Subject: [PATCH] Bump compose-go 1.1.0 Signed-off-by: Ulysses Souza --- go.mod | 2 +- go.sum | 4 ++-- pkg/compose/create.go | 10 +++------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index a43f3fd59b..a4c1dda17a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.2 github.com/buger/goterm v1.0.4 github.com/cnabio/cnab-to-oci v0.3.1-beta1 - github.com/compose-spec/compose-go v1.0.9 + github.com/compose-spec/compose-go v1.1.0 github.com/containerd/console v1.0.3 github.com/containerd/containerd v1.6.0 github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e diff --git a/go.sum b/go.sum index 8a42c9601f..34189c17fa 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoC github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/compose-spec/compose-go v1.0.5/go.mod h1:LQ/JAjSIyh8bTu4RV6nkyf0Ow/Yf3qpvzrdEigxduiw= -github.com/compose-spec/compose-go v1.0.9 h1:mLEdaXkxgO7rUJEa+WoFjwl08LuoW7PeYwey74Z3jao= -github.com/compose-spec/compose-go v1.0.9/go.mod h1:rHEHEY6CRqTAsRy+qvxWSr5GmqzgLWspRD0zloT9GOk= +github.com/compose-spec/compose-go v1.1.0 h1:n/0O7Fl90doi5AG9bfF0SOSLXtveXxLkGXblSrxVC5Q= +github.com/compose-spec/compose-go v1.1.0/go.mod h1:pAy7Mikpeft4pxkFU565/DRHEbDfR84G6AQuiL+Hdg8= github.com/compose-spec/godotenv v1.1.0/go.mod h1:zF/3BOa18Z24tts5qnO/E9YURQanJTBUf7nlcCTNsyc= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= diff --git a/pkg/compose/create.go b/pkg/compose/create.go index ce25512518..960572422f 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -638,15 +638,11 @@ func buildContainerPortBindingOptions(s types.ServiceConfig) nat.PortMap { bindings := nat.PortMap{} for _, port := range s.Ports { p := nat.Port(fmt.Sprintf("%d/%s", port.Target, port.Protocol)) - bind := bindings[p] binding := nat.PortBinding{ - HostIP: port.HostIP, + HostIP: port.HostIP, + HostPort: port.Published, } - if port.Published > 0 { - binding.HostPort = fmt.Sprint(port.Published) - } - bind = append(bind, binding) - bindings[p] = bind + bindings[p] = append(bindings[p], binding) } return bindings }