» LXC Driver

Name: lxc

The lxc driver provides an interface for using LXC for running application containers.

» Task Configuration

task "busybox" {
  driver = "lxc"

  config {
    log_level = "trace"
    verbosity = "verbose"
    template = "/usr/share/lxc/templates/lxc-busybox"
  }
}

The lxc driver supports the following configuration in the job spec:

  • template - The LXC template to run.

    config {
      template = "/usr/share/lxc/templates/lxc-alpine"
    }
    
  • log_level - (Optional) LXC library's logging level. Defaults to error. Must be one of trace, debug, info, warn, or error.

    config {
      log_level = "debug"
    }
    
  • verbosity - (Optional) Enables extra verbosity in the LXC library's logging. Defaults to quiet. Must be one of quiet or verbose.

    config {
      verbosity = "quiet"
    }
    

» Networking

Currently the lxc driver only supports host networking. See the none networking type in the lxc.container.conf manual for more information.

» Client Requirements

The lxc driver requires the following:

  • 64-bit Linux host
  • The linux_amd64_lxc Nomad binary
  • liblxc to be installed
  • lxc-templates to be installed

» Client Configuration

  • lxc.enable - The lxc driver may be disabled on hosts by setting this [client configuration][/docs/agent/configuration/client.html##options-parameters] option to false (defaults to true).

» Client Attributes

The lxc driver will set the following client attributes:

» Resource Isolation

This driver supports CPU and memory isolation via the lxc library. Network isolation is not supported as of now.