moby / libnetwork

networking for containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get libnetwork due to github.com/docker/docker/pkg/tlsconfig missing

rsasum opened this issue · comments

Hi,

I wanted to try the example in the libnetwork readme. But unfortunately I cannot get the example compile because go get to retrieve dependencies fails:

go get github.com/docker/libnetwork
github.com/docker/libnetwork imports
        github.com/docker/libnetwork/config imports
        github.com/docker/docker/pkg/tlsconfig: cannot find module providing package github.com/docker/docker/pkg/tlsconfig
github.com/docker/libnetwork imports
        github.com/docker/libnetwork/drivers/bridge imports
        github.com/docker/libnetwork/portmapper imports
        github.com/docker/docker/pkg/proxy: cannot find module providing package github.com/docker/docker/pkg/proxy

I tried to install different specific versions, but none worked. What can I do?

Running into this issue as well. it seems to be because this change is not in the version that go get tries to pull by default (v0.5.6).

i then tried latest commit with go get github.com/docker/libnetwork@master but that failed with another error:

go get github.com/docker/libnetwork@master
go: downloading github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14
go: downloading github.com/BurntSushi/toml v1.0.0
go: downloading github.com/armon/go-radix v1.0.0
go: downloading github.com/godbus/dbus/v5 v5.1.0
go: downloading github.com/hashicorp/memberlist v0.3.1
go: downloading golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9
# github.com/vishvananda/netlink/nl
/Volumes/workplace/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20201029203352-d40f9887b852/nl/parse_attr.go:26:9: undefined: rtaAlignOf
/Volumes/workplace/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20201029203352-d40f9887b852/nl/parse_attr.go:43:23: undefined: NLA_F_NESTED
/Volumes/workplace/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20201029203352-d40f9887b852/nl/parse_attr.go:44:57: undefined: NLA_TYPE_MASK
/Volumes/workplace/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20201029203352-d40f9887b852/nl/parse_attr.go:53:15: undefined: NLA_F_NET_BYTEORDER
/Volumes/workplace/go/pkg/mod/github.com/vishvananda/netlink@v1.1.1-0.20201029203352-d40f9887b852/nl/parse_attr.go:62:15: undefined: NLA_F_NET_BYTEORDER
# github.com/docker/libnetwork/portallocator
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/portallocator/portallocator.go:115:21: undefined: getDynamicPortRange
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/portallocator/portallocator.go:117:19: cannot assign int to start in multiple assignment
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/portallocator/portallocator.go:117:19: cannot assign int to end in multiple assignment
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/portallocator/portallocator.go:117:19: cannot assign error to err in multiple assignment
# github.com/docker/libnetwork/osl
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:31:60: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:65:75: undefined: NeighOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:96:19: undefined: NeighOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:100:14: undefined: NeighOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:106:15: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:109:31: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:112:22: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:115:26: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:118:35: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:123:17: undefined: IfaceOption
/Volumes/workplace/go/pkg/mod/github.com/docker/libnetwork@v0.8.0-dev.2.0.20210525090646-64b7a4574d14/osl/sandbox.go:123:17: too many errors

which seems to be because those are not defined for every platform and i am on a mac.

I then try GOOS=linux go get github.com/docker/libnetwork@master, which works for me.

Thanks a lot, that worked for me too.