Skip to content

Instantly share code, notes, and snippets.



Last active Aug 25, 2016
What would you like to do?
Setting up drone with docker
image: ruby2.0.0
- cp config/database.example.yml config/database.yml
- bundle install
- psql -c 'create extension hstore;' -U postgres -h
- psql -c 'create role exmu with superuser login;' -U postgres -h
- psql -c 'create database exmu_test;' -U postgres -h
- bundle exec rake db:test:prepare
- bundle exec rspec spec
- postgres:9.1
- elasticsearch dockerfile/elasticsearch 9200
# /etc/init/drone.conf
start on (filesystem and net-device-up)
chdir /var/lib/drone
console log
if [ -f /etc/default/$UPSTART_JOB ]; then
. /etc/default/$UPSTART_JOB
/root/go/bin/droned $DRONED_OPTS
end script

First, read this post:

Install Drone

To use the custom service (as I did with elasticsearch) you have to install drone from source using my fork ( which BTW merges the work done by @yosssi (yosssi/custom-services).

Install Go 1.2

So prepare to install Go 1.2: use godeb if you want an easy way to do that, or follow this guide.

Than add these two lines in your .profile

export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH

Install Drone from source

To install Drone from source, follow their guide: Remember though, the cloned repo should be and it should be put under go/src/ so that the make command can succeeed.

Alternative installation

Executing make install will install drone in

  • /usr/local/bin
  • /etc/init/drone.conf
  • /etc/defaults/drone

While make dpkg will build the .deb package.

Running drone as a non-root user

  1. groupadd docker
  2. useradd --system -d /var/lib/drone -s /bin/false -G docker drone
  3. restart docker with service docker restart
  4. add these lines in /etc/init.drone.conf (under "console log")
setuid drone
setgid drone

Running Drone

To run Drone easily, we symlinked the two binaries (drone and droned)

ln -s $GOPATH/src/ $GOPATH/bin/
ln -s $GOPATH/src/ $GOPATH/bin/

To start Drone, we use the script listed below.

Drone SMTP configuration with GMAIL

To configure Drone to send email using a Gmail account, fill the Settings section with there values

  • SMTP Server:
  • SMTP Port: 587
  • SMTP From Address: <my_account>
  • SMTP Username and Password: <my_account> / <my_password>

Then follow this link to allow Drone to send mail:


Logs are under /var/log/upstart/drone.log and /var/log/upstart/docker.log.

# chmod +x
$GOPATH/bin/droned --log.debug=true --datasource=/var/lib/drone/drone.sqlite --port=:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment