5 ms·
Docker will only let you cross-compile to OSes with the same kernel, which is relatively limited. A full set of say vagrant files would be slower, but a lot mor
by herge 10y ago
Docker will only let you cross-compile to OSes with the same kernel, which is relatively limited. A full set of say vagrant files would be slower, but a lot more polyvalent (but even then it would not let you, say, compile a windows binary from linux).
- detaro 10y agoYou can cross-compile to completely different environments. It just can be tricky to set up, so prepared docker images with e.g. the toolchain to build a Windows executable on Linux are great to have, and what is provided here.
- cryptarch 10y agoI think it's a nice idea in theory to provide cross-compilation support by means of emulating all possible target architectures on the compiling machine. Then I remember that I'd be managing a custom heterogenous compute cluster just to compile some code.
- mentat 10y agoIt's not emulation, it's cross-compilation which has existed basically forever. You don't have to target the same instruction set as the one you're compiling on.
- cryptarch 10y agoI am well aware of that, I was referencing the concept of "cross-compilation" the GP seemed to have.
- mentat 10y agoI see what you mean now, using like qemu or something. So "emulated native compilation". It is an interesting concept. Sorry for misunderstanding you.
- cryptarch 10y agoIndeed, "virtualbox-the-crosscompiler" (probably from hell). QEMU would be a few orders of magnitude slower but I think it supports many more archs. No hard feelings :)
- seiferteric 10y agoAs long as they provide the correct kernel headers and library headers (libc etc) for your target, it should work fine in docker.
- lmb 10y agoGo doesn't really use libc all that much. Syscalls are also implemented in pure go + as, so there aren't really header files to provide. That makes for a great cross-compilation story.