Skip to content
Snippets Groups Projects
Commit acf1232e authored by rockyluke's avatar rockyluke
Browse files

Update Docker volume examples

parent be383a19
No related branches found
No related tags found
No related merge requests found
...@@ -108,17 +108,34 @@ Example: ...@@ -108,17 +108,34 @@ Example:
services = ["mysql", "redis:2.8", "postgres:9"] services = ["mysql", "redis:2.8", "postgres:9"]
``` ```
Another example: #### Volumes in the [runners.docker] section
You can find the complete guide of Docker volume usage [here](https://docs.docker.com/userguide/dockervolumes/).
Let's use some examples to explain how it work (we assume we have a working runners).
Example 1 : adding a data volume
A data volume is a specially-designated directory within one or more containers that bypasses the Union File System. Data volumes are designed to persist data, independent of the container's life cycle.
```bash ```bash
[[runners]] [runners.docker]
name = "ruby-2.1-docker" host = ""
url = "https://CI/" hostname = ""
token = "TOKEN" tls_cert_path = "/Users/ayufan/.boot2docker/certs"
limit = 0 image = "ruby:2.1"
executor = "docker" privileged = false
builds_dir = "/srv/builds" disable_cache = true
volumes = ["/path/to/volume/in/container"]
```
This will create a new volume inside the container at /path/to/volume/in/container.
Example 2 : mount a host directory as a data volume
In addition to creating a volume using you can also mount a directory from your Docker daemon's host into a container. It's usefull when you want to store builds outside the container.
```bash
[runners.docker] [runners.docker]
host = "" host = ""
hostname = "" hostname = ""
...@@ -126,10 +143,11 @@ Another example: ...@@ -126,10 +143,11 @@ Another example:
image = "ruby:2.1" image = "ruby:2.1"
privileged = false privileged = false
disable_cache = true disable_cache = true
wait_for_services_timeout = 30 volumes = ["/path/to/bind/from/host:/path/to/bind/in/container:rw"]
volumes = ["/srv/builds:/srv/builds:rw"]
``` ```
This will use /path/to/bind/from/host of the CI host inside the container at /path/to/bind/in/container.
### The [runners.parallels] section ### The [runners.parallels] section
This defines the Parallels parameters. This defines the Parallels parameters.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment