3 ms·
For those of you who want to see the source code, here is a link to the github repo. Feel free to fork, and do what you like to make it better for you. https://
by KenCochrane 14y ago
For those of you who want to see the source code, here is a link to the github repo. Feel free to fork, and do what you like to make it better for you. https://github.com/kencochrane/golang-on-dotcloud https://github.com/kencochrane/golang-on-dotcloud
- BarkMore 14y agoWhy do you build in the server instead of cross compiling on the client and pushing a binary? Cross compiling will allow developers to use GOPATH instead collecting all dependencies in a directory tree for upload dotCloud.
- KenCochrane 14y agoI could have done that but, but I decided to build on the server for a few reasons. 1. I wanted to keep this custom service similar to other dotCloud custom services where they build on the server. 2. I didn't want to have to worry about trying to build on the client, there are a lot of unknowns, where as on the server I know what is going on and it is in a controlled environment. 3. I'm still new to Go, and I wanted to keep things as simple as possible to start. I'm not opposed to doing the cross compiling on the client, I just needed to make a choice, and I picked the server side instead. If I hear from people that it is better to do this on the client, I'd be happy to accept a pull request to change it.
- jpetazzo 14y agoCompiling Go code is super easy; but how easy it is to cross-compile from e.g. OS X to Linux? Or from Windows to Linux? And would there be an advantage over the current situation? (This is a genuinely naive question; I'm fairly new to Go!)
- shykes 14y agoSupport for cross-compiling is definitely awesome in Go. Here's a good walkthrough: http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c... It's not out-of-the-box though. You still have to build Go itself once for each target, so kencochrane is right: it's still easier to rely on dotCloud to build server-side.
- NateDad 14y agoCross compiling is easy. Follow the steps here: http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c... You can compile from any OS, for any OS. I compile for 32 and 64 bit versions of Windows, OSX, and Linux for my applications. It takes about 5 seconds for all the builds (running serially) to complete. [edit] Bah, beat by shykes. It's still not hard.
- deleted 14y ago[deleted]