Skip to content

Instantly share code, notes, and snippets.

@anis-campos
Last active December 15, 2018 22:25
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anis-campos/31864e8d3fe7e323c738a8c7160e64ad to your computer and use it in GitHub Desktop.
Save anis-campos/31864e8d3fe7e323c738a8c7160e64ad to your computer and use it in GitHub Desktop.
Cross-compile Elastic Filebeat for ARM with docker. Works Raspberry Pi 2
#----- Create a Docker for cross-compilation -----#
mkdir build && cd $_
docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash
#----- Inside docker -----#
go get github.com/elastic/beats
cd /go/src/github.com/elastic/beats/filebeat/
git checkout v5.6.3
GOARCH=arm go build
cp filebeat /build
exit
#----- Verify the outputfile -----#
file filebeat
#filebeat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment