Completes the addition of go module support, including vendored builds#1
Conversation
|
Thanks! |
|
\o/ Thanks for getting it started :) |
|
Sorry for maybe dumb question here, but I'm not very proficient with Docker. I cd'd into docker/go-1.11.x and ran I realized that this was because the changes are on a branch, not master of this repo, so I switched to the branch and rebuilt, but the changes didn't get picked up. I tried switching to Am I on the right track here? |
|
It looks like We actually forked xgo and added support for go modules (among other things) which works: https://github.com/techknowlogick/xgo. This one is also more up to date and activly maintained. We use it to build Gitea with go modules enabled. If you just want something "which works" I'd reccomend trying it. |
|
Thanks, I was hopeful there for a minute, but it doesn't seem to work for me because: techknowlogick/xgo#16 |
Enables support for building projects using Go 1.11+ modules (
karalabe#138). This support assumes that you have either (a) cloned the root repository of the package you wish to build, or (b) that you are outside of
GOPATHin a folder containing ago.modfile. Seego help modulesfor details.Example usage:
xgo --targets=darwin/amd64,linux/amd64 -image zgramana-xgo .Given the file
./go.modwhere the first line ismodule foo_bar, the above command will output two binaries namedfoo_bar-darwin-10.6-amd64andfoo_bar-linux-amd64.vendorSupportIf you first run
go mod vendorin your repository root and then runxgo, it will automatically detect/vendorand pass-mod=vendortogo build(the door is left open for supporting-mod=readonly).