Skip to content

Commit

Permalink
Document relative vs absolute volume paths
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Oct 24, 2016
1 parent d3a99ac commit 31a8149
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
16 changes: 12 additions & 4 deletions website/source/docs/drivers/docker.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,19 @@ The `docker` driver supports the following configuration in the job spec:
```

* `volumes` - (Optional) A list of `host_path:container_path` strings to bind
host paths to container paths. Can be disabled on clients by setting the
`docker.volumes.enabled` option set to false.
host paths to container paths. Mounting host paths outside of the alloc
directory tasks normally have access to can be disabled on clients by setting
the `docker.volumes.enabled` option set to false.

```hcl
config {
volumes = ["/path/on/host:/path/in/container"]
volumes = [
# Use absolute paths to mount arbitrary paths on the host
"/path/on/host:/path/in/container",
# Use relative paths to rebind paths already in the allocation dir
"relative/to/alloc:/also/in/container"
]
}
```

Expand Down Expand Up @@ -364,7 +371,8 @@ options](/docs/agent/config.html#options):
prevent Nomad from removing images from stopped tasks.

* `docker.volumes.enabled`: Defaults to `true`. Allows tasks to bind host paths
(`volumes`) inside their container.
(`volumes`) inside their container. Binding relative paths is always allowed
and will be resolved relative to the allocation's directory.

* `docker.volumes.selinuxlabel`: Allows the operator to set a SELinux
label to the allocation and task local bind-mounts to containers. If used
Expand Down
17 changes: 13 additions & 4 deletions website/source/docs/drivers/rkt.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,19 @@ The `rkt` driver supports the following configuration in the job spec:
* `debug` - (Optional) Enable rkt command debug option.

* `volumes` - (Optional) A list of `host_path:container_path` strings to bind
host paths to container paths. Can be disabled on clients by setting the
`rkt.volumes.enabled` option set to false.
host paths to container paths. Mounting host paths outside of the alloc
directory tasks normally have access to can be disabled on clients by setting
the `rkt.volumes.enabled` option set to false.

```hcl
config {
volumes = ["/path/on/host:/path/in/container"]
volumes = [
# Use absolute paths to mount arbitrary paths on the host
"/path/on/host:/path/in/container",
# Use relative paths to rebind paths already in the allocation dir
"relative/to/alloc:/also/in/container"
]
}
```

Expand All @@ -98,7 +105,9 @@ The `rkt` driver has the following [client configuration
options](/docs/agent/config.html#options):

* `rkt.volumes.enabled`: Defaults to `true`. Allows tasks to bind host paths
(`volumes`) inside their container.
(`volumes`) inside their container. Binding relative paths is always allowed
and will be resolved relative to the allocation's directory.


## Client Attributes

Expand Down

0 comments on commit 31a8149

Please sign in to comment.