How to deploy drone on raspberry pi?

So far I’ve try the image on the dockerhub, nothing work.

I successfully build and run drone on my host machine, however not working on docker.
Compile on a pi and build a image frome armhf/alpine arm32v6/alpine arm64v8/alpine, all failed with

standard_init_linux.go:195: exec user process caused “exec format error”

Any one successfully deploy on raspberry pi?

This error is a low-level Go error that indicates the binary has not been compiled for the correct architecture. You need to make sure you compile the Drone binary for the correct target architecture and the correct arm version, using the correct GOARM, GOOS and GOARCH. Note that the Drone binary cannot be cross-compiled. This means you must compile the Drone binary directly on the Raspberry Pi.

The main Dockerfile in the project will work on any architecture. You do not need to change the main Dockerfile or base image.

I am compile on the Raspberry Pi, but not specify the GOARM, GOOS and GOARCH. Can you suggest the correct values. I’m using a Raspberry Pi 3 Model B

The Raspberry Pi 3 is the third-generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016.

  • Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
  • 1GB RAM
  • BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
  • 40-pin extended GPIO
  • 4 USB 2 ports
  • 4 Pole stereo output and composite video port
  • Full size HDMI
  • CSI camera port for connecting a Raspberry Pi camera
  • DSI display port for connecting a Raspberry Pi touchscreen display
  • Micro SD port for loading your operating system and storing data
  • Upgraded switched Micro USB power source up to 2.5A

My guess is GOARM=7, GOOS=linux and GOARCH=arm, can you confirm that.

The thing is that I’ve successfully compile and run it on the host machine(raspberry pi 3b), which means the architecture is correct, right? But failed on docker image.

many thanks

# build a static binary with the build number and extra features.
go build -ldflags '-extldflags "-static" -X'${DRONE_BUILD_NUMBER} -o release/drone-server
GOOS=linux GOARCH=amd64 CGO_ENABLED=0         go build -ldflags '-X'${DRONE_BUILD_NUMBER} -o release/drone-agent   
GOOS=linux GOARCH=arm64 CGO_ENABLED=0         go build -ldflags '-X'${DRONE_BUILD_NUMBER} -o release/linux/arm64/drone-agent
GOOS=linux GOARCH=arm   CGO_ENABLED=0 GOARM=7 go build -ldflags '-X'${DRONE_BUILD_NUMBER} -o release/linux/arm/drone-agent

I should build static binary. And community edition does not contain extra feature.

go build -ldflags '-extldflags "-static" -X'${DRONE_BUILD_NUMBER} -o release/drone-server

Finally it work, thanks!