1

First, I downloaded the drone image:

go get github.com/drone/drone/cmd/...

Second, I built the image for arm:

GOARM=7 go build -o release/drone-server github.com/drone/drone/cmd/drone-server

After that, I built the image for docker:

docker -f ./go-workspace/src/github.com/drone/drone/Dockerfile build -t drone/drone .

The docker file looks like so:

# docker build --rm -t drone/drone .

FROM drone/ca-certs
EXPOSE 8000 9000 80 443

ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
ENV XDG_CACHE_HOME /var/lib/drone

ADD release/drone-server /bin/

ENTRYPOINT ["/bin/drone-server"]

That's my docker-compose.yml:

version: '2'

services: 
    drone-server: 
        image: drone/drone:latest
        ports: 
            - 8000:8000
            - 9000:9000
        volumes: 
            - /var/lib/drone:/var/lib/drone
        restart: always
        env_file: 
            - /etc/drone/server.env

    drone-agent: 
        image: drone/agent:linux-arm
        command: agent
        depends_on: 
            - drone-server
        volumes: 
            - /var/run/docker.sock:/var/run/docker.sock
        restart: always
        env_file: 
            - /etc/drone/agent.env

The agent.env file:

DRONE_SECRET=xxx
DRONE_SERVER=[server-hostname]:9000
DOCKER_ARCH=arm

The server.env file:

# Service settings
DRONE_SECRET=xxx 
DRONE_HOST=https://[server-hostname]/drone
DRONE_OPEN=false

DRONE_GOGS=true
DRONE_GOGS_URL=https://[server-hostname]/git
DRONE_GOGS_PRIVATE_MODE=true

However, when running docker-compose -f /etc/drone/docker-compose.yml up, I get the following error:

drone-server_1  | standard_init_linux.go:190: exec user process caused "no such file or directory"

And the drone-server exits with code 1.

I configured Apache to reach drone trough a proxy as described here: http://readme.drone.io/0.5/install/setup/apache/

Any help is appreciated.

j3141592653589793238
  • 1,810
  • 2
  • 16
  • 38
  • 2
    So the go binary is arm7 but I'm assuming that the docker image was built on amd64 arch? AFAIK that isn't going to work, instead you need an arm base docker image (like https://hub.docker.com/r/janeczku/armhf-drone/) and you'll need to build the custom image on arm too. – byrnedo Aug 12 '18 at 10:59
  • I notice the op is using `GOARM=7` but what is the GOOS and GOARCH? You must compile the code on a linux arm64 machine. The server cannot be cross-compiled. FWIW the docker image is built FROM scratch, with only ca-cert files, and will work with any architecture. – Brad Rydzewski Aug 13 '18 at 06:59

0 Answers0