I'm creating a test beat and after following the code generator every thing seems to work of.
Working with a Gitlab based CI system I tried to run the "make package" inside docker.
The docker has the docker socket in a volume inside the container so it can create new containers.
Everything runs fine until it tries to run the container:
# cross compile on ubuntu docker run --rm \ -v /go/src/local/testbeat/vendor/github.com/elastic/beats/dev-tools/packer/xgo-scripts:/scripts \ -v /go/src/local/testbeat/vendor/github.com/elastic/beats/dev-tools/packer:/templates \ -v /go/src/local:/source \ -v /go/src/local/testbeat/build:/build \ -e PACK=testbeat \ -e BEFORE_BUILD=before_build.sh \ -e SOURCE=/source \ -e TARGETS="windows/amd64 windows/386 darwin/amd64" \ -e BUILDID=7a6d7ef0f149ea8ce6c2a87a5c8b749d2b3c0262 \ -e ES_BEATS=./vendor/github.com/elastic/beats \ -e BEAT_PATH=local/testbeat \ -e BEAT_NAME=piwikbeat \ tudorg/beats-builder Working directory=/go/src/local/ Copying main source folder /source to folder /go/src/local/ Fetching dependencies... chmod: cannot access '/scripts/before_build.sh':
The problem is that the path /go/src/local/testbeat/ exists inside the first container and not on the host machine.
I don't know enough about the package process or docker to find a way to fix this.
Does anyone have an idea on how I could fix this problem without running the "make package" on a linux machine on the host machine or a VM?