github.com/gunjan5/docker@v1.8.2/daemon/execdriver/execdrivers/execdrivers_linux.go (about)

     1  // +build linux
     2  
     3  package execdrivers
     4  
     5  import (
     6  	"fmt"
     7  	"path"
     8  
     9  	"github.com/Sirupsen/logrus"
    10  	"github.com/docker/docker/daemon/execdriver"
    11  	"github.com/docker/docker/daemon/execdriver/lxc"
    12  	"github.com/docker/docker/daemon/execdriver/native"
    13  	"github.com/docker/docker/pkg/sysinfo"
    14  )
    15  
    16  func NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
    17  	switch name {
    18  	case "lxc":
    19  		// we want to give the lxc driver the full docker root because it needs
    20  		// to access and write config and template files in /var/lib/docker/containers/*
    21  		// to be backwards compatible
    22  		logrus.Warn("LXC built-in support is deprecated.")
    23  		return lxc.NewDriver(root, libPath, initPath, sysInfo.AppArmor)
    24  	case "native":
    25  		return native.NewDriver(path.Join(root, "execdriver", "native"), initPath, options)
    26  	}
    27  	return nil, fmt.Errorf("unknown exec driver %s", name)
    28  }