You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to use some of the docker API due to vendoring issues #29362
cannot use portBindings (type "github.com/docker/go-connections/nat".PortMap) as type "github.com/docker/docker/vendor/github.com/docker/go-connections/nat".PortMap in field value
cannot use ulimits (type []*"github.com/docker/go-units".Ulimit) as type []*"github.com/docker/docker/vendor/github.com/docker/go-units".Ulimit in field value
I cannot use the vendored versions, so how can I get around this?
Steps to reproduce the issue:
Try to create a container.HostConfig using github.com/docker/go-connections/nat.PortMap or github.com/docker/go-units.Ulimit
Describe the results you received:
Failed to compile
Describe the results you expected:
Compile
Reacted by Jonathan Camp, Etienne Bruines, Golo Roden, Weerayut Hongsa, ns-cweber, Adam Stankiewicz, Gergely Bräutigam, Alexey Malov, Tom Mertz, Xavier Vello and 14 more
If you're using docker/docker as a dependency to your project you should manage your dependencies using a tool like vndr or glide. You shouldn't rely on the vendor/ directory in this project.
The workaround is to remove the vendor/ folder of the docker/docker after getting it. It's a little bit tricky depending on what you are using to manage your dependencies though.
@tamird I do agree it's not the best. It's just the current workaround, and I really wish we could somehow make it work. Having a vendor folder is a huge enhancement on the development on docker/docker itself as we don't rely on some autopath hack anymore but it broke users of the client side.
Still looking at some possible ideas like extracting the client client.APIClient to a repository for each tagged version of docker (i.e. any RC and GA releases) or something else.
Agreeing with @tamird here that it would be really great if the API client could be returned to it's own repository and be vendored into docker/docker along with all of the other dependencies.
A couple of other alternatives:
the API client does not expose any of the vendored types directly.
the docker/docker project uses a tool like glide and does not actually store the vendor directory in the git repository, but installs them at build time.
For what its worth, I am using glide for dependencies, but that doesn't resolve the issue by itself, just makes for more interesting error messages. I've now added:
glide install --strip-vendor
As part of my 'dependencies' make target. But it just feels a little dirty. Works for now though.
Any movement on this? It's still in a pretty nasty state :(
I went to use a project I wrote back a year or two ago, to find something was busted between the N docker repos + the various vendor dirs in each of them.
Example:
cannot use index (type *"github.com/docker/docker/api/types/registry".IndexInfo) as type *"github.com/docker/cli/vendor/github.com/docker/docker/api/types/registry".IndexInfo in argument to command.ResolveAuthConfig
This totally breaks depending on docker/docker from Bazel build files (need to fork each and every docker repository and remove the vendor directories, and rebase to keep in sync), since https://github.com/bazelbuild/bazel-gazelle cannot ignore vendor directories for dependencies. Are there any plans to remove the vendor directory (especially in the light of Go modules)?
Just wanted to chime in here, several years later, that this is still a recurring and prevalent issue. My existing workaround was deleting the vendor folder, but this is entirely impractical and absurd. Currently trying to solve the issue with go deps. Life is pain.
This issue was related to the original change to switch to use vendor/ as the path for vendoring, which is the standard path for vendored dependencies. The solution for that is to use a vendoring tool that strips nested dependencies (or to configure the tool you're using to do so).
Unfortunately, using go modules with this repository is still difficult (and complicated to resolve). There are some newer issues that discuss this, and which are more current. Let me close this one in favour of those, and link to some comments on those that may be helpful #39056 (#39056 (comment)) and #39302 (#39302 (comment))
Activity
tamird commentedon Dec 13, 2016
This was introduced in #27912 (comment) and a fix was previously attempted in #28080, which was closed without explanation.
cc @LK4D4
vdemeester commentedon Dec 13, 2016
Quoting @dnephin on this as I do agree with him.
The workaround is to remove the
vendor/folder of thedocker/dockerafter getting it. It's a little bit tricky depending on what you are using to manage your dependencies though.And as @tiborvass said
tamird commentedon Dec 13, 2016
vdemeester commentedon Dec 13, 2016
@tamird I do agree it's not the best. It's just the current workaround, and I really wish we could somehow make it work. Having a
vendorfolder is a huge enhancement on the development on docker/docker itself as we don't rely on some autopath hack anymore but it broke users of the client side.Still looking at some possible ideas like extracting the client
client.APIClientto a repository for each tagged version of docker (i.e. any RC and GA releases) or something else.jeffw-wherethebitsroam commentedon Dec 14, 2016
Agreeing with @tamird here that it would be really great if the API client could be returned to it's own repository and be vendored into docker/docker along with all of the other dependencies.
A couple of other alternatives:
For what its worth, I am using glide for dependencies, but that doesn't resolve the issue by itself, just makes for more interesting error messages. I've now added:
As part of my 'dependencies' make target. But it just feels a little dirty. Works for now though.
jeffw-wherethebitsroam commentedon Dec 16, 2016
Also, see https://groups.google.com/forum/#!msg/golang-nuts/AnMr9NL6dtc/UnyUUKcMCAAJ
ds0nt commentedon Jan 12, 2017
Well then... wow.
CpuID commentedon Jul 20, 2018
Any movement on this? It's still in a pretty nasty state :(
I went to use a project I wrote back a year or two ago, to find something was busted between the N
dockerrepos + the various vendor dirs in each of them.Example:
CpuID commentedon Jul 20, 2018
I think I worked around my issues for now, by going:
And then ensured my version of
cobra/spf13+cobra/pflagwere up to date. Not elegant, but technically works around my issues.Xjs commentedon Sep 6, 2018
This totally breaks depending on
docker/dockerfrom Bazel build files (need to fork each and every docker repository and remove the vendor directories, and rebase to keep in sync), since https://github.com/bazelbuild/bazel-gazelle cannot ignore vendor directories for dependencies. Are there any plans to remove thevendordirectory (especially in the light of Go modules)?zscole commentedon Jan 31, 2019
Just wanted to chime in here, several years later, that this is still a recurring and prevalent issue. My existing workaround was deleting the vendor folder, but this is entirely impractical and absurd. Currently trying to solve the issue with go deps. Life is pain.
B-Lukas commentedon Apr 21, 2019
I am currently also stuck with this. It's very frustrating trying to get it to work with vendoring in a Pipeline
rach-id commentedon Jul 26, 2020
Any update on this ?
akerouanton commentedon Jul 26, 2020
@sweexordious You can take a look at this comment from @thaJeztah, he explains what procedure should be followed to get it work with
go mod😉thaJeztah commentedon Jul 26, 2020
This issue was related to the original change to switch to use
vendor/as the path for vendoring, which is the standard path for vendored dependencies. The solution for that is to use a vendoring tool that strips nested dependencies (or to configure the tool you're using to do so).Unfortunately, using go modules with this repository is still difficult (and complicated to resolve). There are some newer issues that discuss this, and which are more current. Let me close this one in favour of those, and link to some comments on those that may be helpful #39056 (#39056 (comment)) and #39302 (#39302 (comment))