Add documentation for chroot_env client configuration

This commit is contained in:
Jay Oster 2016-08-05 15:59:06 -07:00
parent 2ae059b41d
commit 20d3d00b29
2 changed files with 32 additions and 1 deletions

View file

@ -421,6 +421,9 @@ configured on server nodes.
* <a id="options">`options`</a>: This is a key/value mapping of internal * <a id="options">`options`</a>: This is a key/value mapping of internal
configuration for clients, such as for driver configuration. Please see configuration for clients, such as for driver configuration. Please see
[here](#options_map) for a description of available options. [here](#options_map) for a description of available options.
* <a id="chroot_env">`chroot_env`</a>: This is a key/value mapping that
defines the chroot environment for jobs using the Exec and Java drivers.
Please see [here](#chroot_env_map) for an example and further information.
* <a id="network_interface">`network_interface`</a>: This is a string to force * <a id="network_interface">`network_interface`</a>: This is a string to force
network fingerprinting to use a specific network interface network fingerprinting to use a specific network interface
* <a id="network_speed">`network_speed`</a>: This is an int that sets the * <a id="network_speed">`network_speed`</a>: This is an int that sets the
@ -496,6 +499,31 @@ documentation [here](/docs/drivers/index.html)
If specified, fingerprinters not in the whitelist will be disabled. If the If specified, fingerprinters not in the whitelist will be disabled. If the
whitelist is empty, all fingerprinters are used. whitelist is empty, all fingerprinters are used.
### <a id="chroot_env_map"></a>Client ChrootEnv Map
Drivers based on [Isolated Fork/Exec](/docs/drivers/exec.html) implement file
system isolation using chroot on Linux. The `chroot_env` map allows the chroot
environment to be configured using source paths on the host operating system.
The mapping format is: `source_path -> dest_path`.
The following example specifies a chroot which contains just enough to run the
`ls` utility, and not much else:
```
chroot_env {
"/bin/ls" = "/bin/ls"
"/etc/ld.so.cache" = "/etc/ld.so.cache"
"/etc/ld.so.conf" = "/etc/ld.so.conf"
"/etc/ld.so.conf.d" = "/etc/ld.so.conf.d"
"/lib" = "/lib"
"/lib64" = "/lib64"
}
```
When `chroot_env` is unspecified, the `exec` driver will use a default chroot
environment with the most commonly used parts of the operating system. See
`exec` documentation for the full list [here](/docs/drivers/exec.html#chroot).
## <a id="cli"></a>Command-line Options ## <a id="cli"></a>Command-line Options
A subset of the available Nomad agent configuration can optionally be passed in A subset of the available Nomad agent configuration can optionally be passed in

View file

@ -96,9 +96,12 @@ the client and the configuration.
On Linux, Nomad will use cgroups, and a chroot to isolate the On Linux, Nomad will use cgroups, and a chroot to isolate the
resources of a process and as such the Nomad agent must be run as root. resources of a process and as such the Nomad agent must be run as root.
### Chroot ### <a id="chroot"></a>Chroot
The chroot is populated with data in the following folders from the host The chroot is populated with data in the following folders from the host
machine: machine:
`["/bin", "/etc", "/lib", "/lib32", "/lib64", "/run/resolvconf", "/sbin", `["/bin", "/etc", "/lib", "/lib32", "/lib64", "/run/resolvconf", "/sbin",
"/usr"]` "/usr"]`
This list is configurable through the agent client
[configuration file](/docs/agent/config.html#chroot_env).