From 703cab12e77189432e160772f67e5f131fd14baa Mon Sep 17 00:00:00 2001 From: Ma Shimiao Date: Mon, 16 Mar 2015 15:07:33 +0800 Subject: [PATCH] fix not show error when using --lxc-conf without lxc driver Signed-off-by: Ma Shimiao --- daemon/create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/create.go b/daemon/create.go index ee7df30e0e..e17b63636b 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -2,6 +2,7 @@ package daemon import ( "fmt" + "strings" "github.com/docker/docker/engine" "github.com/docker/docker/graph" @@ -22,6 +23,9 @@ func (daemon *Daemon) ContainerCreate(job *engine.Job) engine.Status { config := runconfig.ContainerConfigFromJob(job) hostConfig := runconfig.ContainerHostConfigFromJob(job) + if len(hostConfig.LxcConf) > 0 && !strings.Contains(daemon.ExecutionDriver().Name(), "lxc") { + return job.Errorf("Cannot use --lxc-conf with execdriver: %s", daemon.ExecutionDriver().Name()) + } if hostConfig.Memory != 0 && hostConfig.Memory < 4194304 { return job.Errorf("Minimum memory limit allowed is 4MB") }