mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #11401 from Mashimiao/11385-fix-lxc-conf-error
fix not show error when using --lxc-conf without lxc driver
This commit is contained in:
commit
8685af0b13
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ package daemon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/docker/engine"
|
"github.com/docker/docker/engine"
|
||||||
"github.com/docker/docker/graph"
|
"github.com/docker/docker/graph"
|
||||||
|
@ -22,6 +23,9 @@ func (daemon *Daemon) ContainerCreate(job *engine.Job) engine.Status {
|
||||||
config := runconfig.ContainerConfigFromJob(job)
|
config := runconfig.ContainerConfigFromJob(job)
|
||||||
hostConfig := runconfig.ContainerHostConfigFromJob(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 {
|
if hostConfig.Memory != 0 && hostConfig.Memory < 4194304 {
|
||||||
return job.Errorf("Minimum memory limit allowed is 4MB")
|
return job.Errorf("Minimum memory limit allowed is 4MB")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue