Can go-dockerclient be built with go modules?

408 views
Skip to first unread message

Joseph Lorenzini

unread,
Aug 11, 2018, 2:08:01 PM8/11/18
to golang-nuts

All:

Using vgo, I haven't been able to build a go package with this library. Using go 1.10, I can successfully build this library.


When I attempt to vgo build, I get this error


According to logrus project (github.com/sirupsen/logrus), the lowercase variant should always be used. So I added, this replace to go.mod.


But then vgo build fails, with this error:


Aside from opening an issue with the library author or forking the library, Is there a standard way to handle this kind of problem so that a program will build again?

Thanks,
Joe 

Constantin Konstantinidis

unread,
Aug 14, 2018, 4:08:54 AM8/14/18
to golang-nuts
An issue is already opened cf. https://github.com/golang/go/issues/22291


On Saturday, August 11, 2018 at 8:08:01 PM UTC+2, Joseph Lorenzini wrote:

All:

Using vgo, I haven't been able to build a go package with this library. Using go 1.10, I can successfully build this library.


When I attempt to vgo build, I get this error


According to logrus project (github.com/sirupsen/logrus), the lowercase variant should always be used. So I added, this replace to go.mod.


But then vgo build fails, with this error:

roger peppe

unread,
Aug 14, 2018, 6:29:31 AM8/14/18
to Joseph Lorenzini, golang-nuts
Please try with Go 1.11 rc1.
(You can explicitly enable modules with GO111MODULE=on, or just try
building outside $GOPATH).
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Peter Waller

unread,
Aug 14, 2018, 6:41:23 AM8/14/18
to jal...@gmail.com, golang-nuts
There are a couple of issues it is useful to be aware of importing when depending on docker as a module.

1. docker's development is fragmented over various repositories, and docker/docker isn't tagged. docker/docker (an alias for moby/moby) still receives code updates imported from the other repositories, but not releases, here you can see the last one is in 2017: https://github.com/docker/docker/releases. If you look at https://github.com/docker/cli/releases you can see there has been a release a week ago. And if you look at the master branch, it has recent commits.

2. docker's recent tags aren't semver, because of the presence of a leading zero in `v17.05.x-foo`. But the project does have old semver tags. So what you're seeing is that a very old version of docker is being pulled in.

It's this old version of docker which is causes an old logrus to be imported.

So you can get, say, a recent version of docker by running this (or substitute @master for a specific release tag or git commit).


There is a bit more work needed to get it to build, but it is possible. Sorry I don't have a complete solution immediately handy right now.

--

Peter Waller

unread,
Aug 16, 2018, 5:55:42 AM8/16/18
to Joseph Lorenzini, golang-nuts
Another issue worth consulting, https://github.com/golang/go/issues/26208, which isn't yet marked as resolved.

Joseph Lorenzini

unread,
Aug 16, 2018, 8:41:20 AM8/16/18
to Peter Waller, golang-nuts
Hi Peter,

Thanks that was very helpful. That issue describes my problem exactly. Frankly, IMHO, the issue isn’t so much modules being buggy as docker being a project with poorly managed versioning. It’s some of the worst I have ever see.

For example, I don’t understand why they haven’t added a git tag for v17.0.5. It makes me wonder whether anyone has asked the docker project if they are willing to do semver and add a go.mod.

Joe
Reply all
Reply to author
Forward
0 new messages