Build Grafana for another platform

I have the Grafana source code on MacOS, and would like to build a binary for linux/386.

I would have thought exporting GOOS and GOARCH and then running “make build” would do the trick, but I’m failing with that approach. The makefile seems to be building intermediate binaries for linux/386 that aren’t compatible with MacOS.

What’s the correct way to go about this?

Check scripts in the repo, e. g.

Thanks for this feedback. I made a little progress with the commands you guided me towards, but quickly became familiar with things like “cgo” and decided that for for my needs, cross-compling Grafana isn’t worth the effort required. I resorted to trying to compile on the lone platform I’m interested in, and am working through the obstacles I’ve encountered there.

Below are some of the articles I read during this process, for anyone stumbling across this thread seeking to do the same (spread out across multiple posts because I’m New).

1 Like