docker/go-docker

Cannot find package after installing with glide.

valclark1 opened this issue · 5 comments

Hi,

Go version: 1.9
Package manager: glide v0.13.0

I get this error when following the example in docs.

I did the install using glide and basically did a copy paste of docs

vendor/docker.io/go-docker/container_commit.go:8:2: cannot find package "github.com/docker/distribution/reference" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/docker/distribution/reference (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/docker/distribution/reference (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/docker/distribution/reference (from $GOPATH)
vendor/docker.io/go-docker/api/types/container/config.go:7:2: cannot find package "github.com/docker/go-connections/nat" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/docker/go-connections/nat (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/docker/go-connections/nat (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/docker/go-connections/nat (from $GOPATH)
vendor/docker.io/go-docker/client.go:16:2: cannot find package "github.com/docker/go-connections/sockets" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/docker/go-connections/sockets (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/docker/go-connections/sockets (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/docker/go-connections/sockets (from $GOPATH)
vendor/docker.io/go-docker/client.go:17:2: cannot find package "github.com/docker/go-connections/tlsconfig" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/docker/go-connections/tlsconfig (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/docker/go-connections/tlsconfig (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/docker/go-connections/tlsconfig (from $GOPATH)
vendor/docker.io/go-docker/api/types/container/host_config.go:10:2: cannot find package "github.com/docker/go-units" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/docker/go-units (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/docker/go-units (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/docker/go-units (from $GOPATH)
vendor/docker.io/go-docker/api/types/swarm/runtime/plugin.pb.go:17:8: cannot find package "github.com/gogo/protobuf/proto" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/gogo/protobuf/proto (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/gogo/protobuf/proto (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/gogo/protobuf/proto (from $GOPATH)
vendor/docker.io/go-docker/service_create.go:11:2: cannot find package "github.com/opencontainers/go-digest" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/opencontainers/go-digest (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/opencontainers/go-digest (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/opencontainers/go-digest (from $GOPATH)
vendor/docker.io/go-docker/api/types/registry/registry.go:7:2: cannot find package "github.com/opencontainers/image-spec/specs-go/v1" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/opencontainers/image-spec/specs-go/v1 (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/opencontainers/image-spec/specs-go/v1 (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/opencontainers/image-spec/specs-go/v1 (from $GOPATH)
vendor/docker.io/go-docker/errors.go:9:2: cannot find package "github.com/pkg/errors" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/github.com/pkg/errors (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/github.com/pkg/errors (from $GOROOT)
	/Users/javonclarke/projects/go/src/github.com/pkg/errors (from $GOPATH)
vendor/docker.io/go-docker/build_prune.go:8:2: cannot find package "golang.org/x/net/context" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/golang.org/x/net/context (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/golang.org/x/net/context (from $GOROOT)
	/Users/javonclarke/projects/go/src/golang.org/x/net/context (from $GOPATH)
vendor/docker.io/go-docker/request.go:19:2: cannot find package "golang.org/x/net/context/ctxhttp" in any of:
	/Users/javonclarke/projects/go/src/github.com/javonclarke/vxctl/vendor/golang.org/x/net/context/ctxhttp (vendor tree)
	/usr/local/Cellar/go/1.9/libexec/src/golang.org/x/net/context/ctxhttp (from $GOROOT)
	/Users/javonclarke/projects/go/src/golang.org/x/net/context/ctxhttp (from $GOPATH)

I found out that the issue is installing with glide. glide doesn't install all the dependencies that go-docker requires. It only works with dep. Are there future plans to make it work with other dependency managers?

@javonclarke If not using dep, this should be like any other go package.

Also note, this is not live yet.

Related: Masterminds/glide#915

It would be up to glide to support the dep format.

I also met this issue.

I am really newbee to Golang dependency control. I just use glide get docker.io/go-docker to fetch the dependency locally. Apparently this does command does not get sub-packages for me.

@valclarke Could you please tell me how did you resolve this issue after you met it?

Never mind. glide up --vendor-override -v gets sub-packages.