harness-drone/doc/install-docker.md
2015-05-23 18:52:04 -07:00

1.4 KiB

An official Drone image is available in the Docker registry. This is the recommended way to install and run Drone on non-Ubuntu environments. Pull the latest Drone image to get started:

sudo docker pull drone/drone

An example command to run your Drone instance with GitHub enabled:

sudo docker run -d \
	-v /var/lib/drone:/var/lib/drone \
	-e DRONE_GITHUB_CLIENT=c0aaff74c060ff4a950d \
	-e DRONE_GITHUB_SECRET=1ac1eae5ff1b490892f5546f837f306265032412 \
	-p 80:80 --name=drone drone/drone

Persistence

When running Drone inside Docker we recommend mounting a volume for your sqlite database. This ensures the database is not lost if the container is accidentally stopped and removed. Below is an example that mounts /var/lib/drone on your host machine:

sudo docker run \
	-v /var/lib/drone:/var/lib/drone \
	--name=drone drone/drone

Configuration

When running Drone inside Docker we recommend using environment variables to configure the system. All configuration attributes in the drone.toml may also be provided as environment variables. Below demonstrates how to configure GitHub from environment variables:

sudo docker run \
	-e DRONE_GITHUB_CLIENT=c0aaff74c060ff4a950d \
	-e DRONE_GITHUB_SECRET=1ac1eae5ff1b490892f5546f837f306265032412 \
	--name=drone drone/drone