-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completes the addition of go module support, including vendored builds #1
Completes the addition of go module support, including vendored builds #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this! I have a few improvements though.
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
GOPATH
in a folder containing ago.mod
file. Seego help modules
for details.Example usage:
xgo --targets=darwin/amd64,linux/amd64 -image zgramana-xgo .
Given the file
./go.mod
where the first line ismodule foo_bar
, the above command will output two binaries namedfoo_bar-darwin-10.6-amd64
andfoo_bar-linux-amd64
.vendor
SupportIf you first run
go mod vendor
in your repository root and then runxgo
, it will automatically detect/vendor
and pass-mod=vendor
togo build
(the door is left open for supporting-mod=readonly
).