github.com/ncodes/nomad@v0.5.7-0.20170403112158-97adf4a74fb3/website/source/docs/drivers/lxc.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Drivers: LXC" 4 sidebar_current: "docs-drivers-lxc" 5 description: |- 6 The LXC task driver is used to run application containers using LXC. 7 --- 8 9 # LXC Driver 10 11 Name: `lxc` 12 13 The `lxc` driver provides an interface for using LXC for running application 14 containers. 15 16 !> **Experimental!** Currently, the LXC driver supports launching containers 17 via templates but only supports host networking. If both an LXC image and the 18 host it is run on use upstart or systemd, shutdown signals may be passed from 19 the container to the host. 20 21 ~> LXC is only enabled in the special `linux_amd64_lxc` build of Nomad because 22 it links to the `liblxc` system library. Use the `lxc` build tag if compiling 23 Nomad yourself. 24 25 ## Task Configuration 26 27 ```hcl 28 task "busybox" { 29 driver = "lxc" 30 31 config { 32 log_level = "trace" 33 verbosity = "verbose" 34 template = "/usr/share/lxc/templates/lxc-busybox" 35 } 36 } 37 ``` 38 39 The `lxc` driver supports the following configuration in the job spec: 40 41 * `template` - The LXC template to run. 42 43 ```hcl 44 config { 45 template = "/usr/share/lxc/templates/lxc-alpine" 46 } 47 ``` 48 49 * `log_level` - (Optional) LXC library's logging level. Defaults to `error`. 50 Must be one of `trace`, `debug`, `info`, `warn`, or `error`. 51 52 ```hcl 53 config { 54 log_level = "debug" 55 } 56 ``` 57 58 * `verbosity` - (Optional) Enables extra verbosity in the LXC library's 59 logging. Defaults to `quiet`. Must be one of `quiet` or `verbose`. 60 61 ```hcl 62 config { 63 verbosity = "quiet" 64 } 65 ``` 66 67 ## Networking 68 69 Currently the `lxc` driver only supports host networking. See the `none` 70 networking type in the [`lxc.container.conf` manual][lxc_man] for more 71 information. 72 73 [lxc_man]: https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html#lbAM 74 75 ## Client Requirements 76 77 The `lxc` driver requires the following: 78 79 * 64bit Linux host 80 * The `linux_amd64_lxc` Nomad binary 81 * `liblxc` to be installed 82 * `lxc-templates` to be installed 83 84 ## Client Configuration 85 86 * `lxc.enable` - The `lxc` driver may be disabled on hosts by setting this 87 [client configuration][/docs/agent/configuration/client.html##options-parameters] 88 option to `false` (defaults to `true`). 89 90 ## Client Attributes 91 92 The `lxc` driver will set the following client attributes: 93 94 * `driver.lxc` - Set to `1` if LXC is found and enabled on the host node. 95 * `driver.lxc.version` - Version of `lxc` eg: `1.1.0`. 96 97 ## Resource Isolation 98 99 This driver supports CPU and memory isolation via the `lxc` library. Network 100 isolation is not supported as of now.