woodpecker/docs/setup/index.md

55 lines
1.6 KiB
Markdown
Raw Normal View History

2015-07-07 04:13:50 +00:00
# Installation
2015-05-24 01:52:04 +00:00
To quickly tryout Drone we have a [Docker image](https://registry.hub.docker.com/u/drone/drone/) that includes everything you need to get started. Simply run the commend below:
2015-05-24 01:52:04 +00:00
2015-10-07 21:29:52 +00:00
```
sudo docker pull drone/drone:0.4
```
And then run the container:
```
2015-07-07 04:13:50 +00:00
sudo docker run \
--volume /var/lib/drone:/var/lib/drone \
--volume /var/run/docker.sock:/var/run/docker.sock \
2015-10-07 20:06:14 +00:00
--env-file /etc/drone/dronerc \
2015-07-07 04:13:50 +00:00
--restart=always \
--publish=80:8000 \
--detach=true \
--name=drone \
2015-10-07 21:29:52 +00:00
drone/drone:0.4
2015-05-24 01:52:04 +00:00
```
Drone is now running (in the background) on `http://localhost:80`. Note that before running you should create the `--env-file` and add your Drone configuration (GitHub, Bitbucket, GitLab credentials, etc).
2015-05-24 01:52:04 +00:00
2015-07-07 04:13:50 +00:00
## Docker options
2015-05-24 01:52:04 +00:00
2015-07-07 04:13:50 +00:00
Here are some of the Docker options, explained:
2015-05-24 01:52:04 +00:00
2015-07-07 04:13:50 +00:00
* `--restart=always` starts Drone automatically during system init process
* `--publish=80:8000` runs Drone on port `80`
* `--detach=true` starts Drone in the background
* `--volume /var/lib/drone:/var/lib/drone` mounted volume to persist sqlite database
* `--volume /var/run/docker.sock:/var/run/docker.sock` mounted volume to access Docker and spawn builds
* `--env-file /etc/defaults/drone` loads an external file with environment variables. Used to configure Drone.
2015-05-24 01:52:04 +00:00
2015-07-07 04:13:50 +00:00
## Drone settings
2015-05-24 01:52:04 +00:00
Drone uses environment variables for runtime settings and configuration, such as GitHub, GitLab, plugins and more. These settings can be provided to Docker using an `--env-file` as seen above.
## Starting, Stopping, Logs
Commands to start, stop and restart Drone:
```
2015-10-08 00:17:15 +00:00
sudo docker start drone
sudo docker stop drone
sudo docker restart drone
```
And to view the Drone logs:
```
2015-10-08 00:17:15 +00:00
sudo docker logs drone
```