drone.io

In this post, I will show you how to setup a drone (0.4) server on ARM platform.

  • Edit the /etc/drone/dronerc file

    Get your github token from github setting page, and set agent secret to any random string.

    /etc/dronerc
    1
    2
    3
    4
    5
    REMOTE_DRIVER=github
    REMOTE_CONFIG=https://github.com?client_id=client_token&client_secret=secret_token
    DATABASE_DRIVER=sqlite3
    DATABASE_CONFIG=/var/lib/drone/drone.sqlite
  • Start drone server

    We use pre-built drone image for arm from this repo.

    Mapping port 80 of docker container to port 8000 of hosted server.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    sudo docker run \
    --volume /var/lib/drone:/var/lib/drone \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --env-file /etc/drone/dronerc \
    --restart=always \
    --publish=80:8000 \
    --detach=true \
    --name=drone \
    armhfbuild/drone
  • Hosting

    I hosted my arm based C1 server (ubuntu 16.04 with pre-installed docker) on scaleway for 2.99/month.

  • Docker in docker

    Get the arm version dind image from this repo.The following is an example drone yaml file.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    # drone.io v0.4
    # armhf
    build:
    image: armhfbuild/docker:1.10-dind
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    privileged: true
    commands:
    - docker build --no-cache=true -t takawang/c-modbus-slave:armhf -f Dockerfile.armhf .
    - docker run -itd --name=slave takawang/c-modbus-slave:armhf
    - docker logs slave
    - docker rm -f slave
    - docker push takawang/c-modbus-slave:armhf
  • References