diff --git a/api/types/types.go b/api/types/types.go index ae2057df0c..54cabe5d43 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -264,7 +264,6 @@ type ContainerJSONBase struct { Name string RestartCount int Driver string - ExecDriver string MountLabel string ProcessLabel string AppArmorProfile string diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index fb17b0ec29..12a267eb65 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -659,7 +659,6 @@ _docker_daemon() { --dns --dns-search --dns-opt - --exec-driver -e --exec-opt --exec-root --fixed-cidr diff --git a/contrib/completion/fish/docker.fish b/contrib/completion/fish/docker.fish index 15cde66f02..ac2167b49e 100644 --- a/contrib/completion/fish/docker.fish +++ b/contrib/completion/fish/docker.fish @@ -51,7 +51,6 @@ complete -c docker -f -n '__fish_docker_no_subcommand' -s d -l daemon -d 'Enable complete -c docker -f -n '__fish_docker_no_subcommand' -l dns -d 'Force Docker to use specific DNS servers' complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-opt -d 'Force Docker to use specific DNS options' complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-search -d 'Force Docker to use specific DNS search domains' -complete -c docker -f -n '__fish_docker_no_subcommand' -s e -l exec-driver -d 'Force the Docker runtime to use a specific exec driver' complete -c docker -f -n '__fish_docker_no_subcommand' -l exec-opt -d 'Set exec driver options' complete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr -d 'IPv4 subnet for fixed IPs (e.g. 10.20.0.0/16)' complete -c docker -f -n '__fish_docker_no_subcommand' -l fixed-cidr-v6 -d 'IPv6 subnet for fixed IPs (e.g.: 2001:a02b/48)' diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 7beb44f278..0f1a0f66a1 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -540,7 +540,6 @@ __docker_subcommand() { "($help)*--dns-opt=[DNS options to use]:DNS option: " \ "($help)*--default-ulimit=[Set default ulimit settings for containers]:ulimit: " \ "($help)--disable-legacy-registry[Do not contact legacy registries]" \ - "($help -e --exec-driver)"{-e=,--exec-driver=}"[Exec driver to use]:driver:(native windows)" \ "($help)*--exec-opt=[Set exec driver options]:exec driver options: " \ "($help)--exec-root=[Root of the Docker execdriver]:path:_directories" \ "($help)--fixed-cidr=[IPv4 subnet for fixed IPs]:IPv4 subnet: " \ diff --git a/daemon/config.go b/daemon/config.go index 436f8cdac4..bc301a5300 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -21,7 +21,6 @@ type CommonConfig struct { DNS []string DNSOptions []string DNSSearch []string - ExecDriver string ExecOptions []string ExecRoot string GraphDriver string @@ -62,7 +61,6 @@ func (config *Config) InstallCommonFlags(cmd *flag.FlagSet, usageFn func(string) cmd.StringVar(&config.ExecRoot, []string{"-exec-root"}, "/var/run/docker", usageFn("Root of the Docker execdriver")) cmd.BoolVar(&config.AutoRestart, []string{"#r", "#-restart"}, true, usageFn("--restart on the daemon has been deprecated in favor of --restart policies on docker run")) cmd.StringVar(&config.GraphDriver, []string{"s", "-storage-driver"}, "", usageFn("Storage driver to use")) - cmd.StringVar(&config.ExecDriver, []string{"e", "-exec-driver"}, defaultExec, usageFn("Exec driver to use")) cmd.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, usageFn("Set the containers network MTU")) // FIXME: why the inconsistency between "hosts" and "sockets"? cmd.Var(opts.NewListOptsRef(&config.DNS, opts.ValidateIPAddress), []string{"#dns", "-dns"}, usageFn("DNS server to use")) diff --git a/daemon/container.go b/daemon/container.go index 61b739aa42..b5f2b7e0d2 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -63,7 +63,6 @@ type CommonContainer struct { LogPath string Name string Driver string - ExecDriver string // MountLabel contains the options for the 'mount' command MountLabel string ProcessLabel string diff --git a/daemon/daemon.go b/daemon/daemon.go index cd55cfdbae..2cb443f0ef 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -489,7 +489,6 @@ func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID base.NetworkSettings = &network.Settings{IsAnonymousEndpoint: noExplicitName} base.Name = name base.Driver = daemon.driver.String() - base.ExecDriver = daemon.execDriver.Name() return base, err } @@ -793,7 +792,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo return nil, fmt.Errorf("Devices cgroup isn't mounted") } - ed, err := execdrivers.NewDriver(config.ExecDriver, config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo) + ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo) if err != nil { return nil, err } diff --git a/daemon/daemon_experimental.go b/daemon/daemon_experimental.go index b65ad7a5b0..58ef6e7205 100644 --- a/daemon/daemon_experimental.go +++ b/daemon/daemon_experimental.go @@ -15,11 +15,8 @@ import ( ) func setupRemappedRoot(config *Config) ([]idtools.IDMap, []idtools.IDMap, error) { - if config.ExecDriver != "native" && config.RemappedRoot != "" { - return nil, nil, fmt.Errorf("User namespace remapping is only supported with the native execdriver") - } - if runtime.GOOS == "windows" && config.RemappedRoot != "" { - return nil, nil, fmt.Errorf("User namespaces are not supported on Windows") + if runtime.GOOS != "linux" && config.RemappedRoot != "" { + return nil, nil, fmt.Errorf("User namespaces are not supported on Linux") } // if the daemon was started with remapped root option, parse diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 8ce9aa1996..edb63d2758 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -166,7 +166,7 @@ func TestLoadWithVolume(t *testing.T) { "HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname", "HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts", "LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log", -"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, +"Name":"/ubuntu","Driver":"aufs","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, "UpdateDns":false,"Volumes":{"/vol1":"%s"},"VolumesRW":{"/vol1":true},"AppliedVolumesFrom":null}` cfg := fmt.Sprintf(config, vfsPath) @@ -255,7 +255,7 @@ func TestLoadWithBindMount(t *testing.T) { "HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname", "HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts", "LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log", -"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, +"Name":"/ubuntu","Driver":"aufs","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, "UpdateDns":false,"Volumes":{"/vol1": "/vol1"},"VolumesRW":{"/vol1":true},"AppliedVolumesFrom":null}` if err = ioutil.WriteFile(filepath.Join(containerPath, "config.json"), []byte(config), 0644); err != nil { @@ -346,7 +346,7 @@ func TestLoadWithVolume17RC(t *testing.T) { "HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname", "HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts", "LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log", -"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, +"Name":"/ubuntu","Driver":"aufs","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, "UpdateDns":false,"MountPoints":{"/vol1":{"Name":"6a3c03fc4a4e588561a543cc3bdd50089e27bd11bbb0e551e19bf735e2514101","Destination":"/vol1","Driver":"local","RW":true,"Source":"","Relabel":""}},"AppliedVolumesFrom":null}` if err = ioutil.WriteFile(filepath.Join(containerPath, "config.json"), []byte(config), 0644); err != nil { @@ -450,7 +450,7 @@ func TestRemoveLocalVolumesFollowingSymlinks(t *testing.T) { "HostnamePath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hostname", "HostsPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/hosts", "LogPath":"/var/lib/docker/containers/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e/d59df5276e7b219d510fe70565e0404bc06350e0d4b43fe961f22f339980170e-json.log", -"Name":"/ubuntu","Driver":"aufs","ExecDriver":"native-0.2","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, +"Name":"/ubuntu","Driver":"aufs","MountLabel":"","ProcessLabel":"","AppArmorProfile":"","RestartCount":0, "UpdateDns":false,"Volumes":{"/vol1":"%s"},"VolumesRW":{"/vol1":true},"AppliedVolumesFrom":null}` cfg := fmt.Sprintf(config, vfsPath) diff --git a/daemon/execdriver/execdrivers/execdrivers_freebsd.go b/daemon/execdriver/execdrivers/execdrivers_freebsd.go index ffb463cefd..fcc5b5220d 100644 --- a/daemon/execdriver/execdrivers/execdrivers_freebsd.go +++ b/daemon/execdriver/execdrivers/execdrivers_freebsd.go @@ -10,10 +10,6 @@ import ( ) // NewDriver returns a new execdriver.Driver from the given name configured with the provided options. -func NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { - switch name { - case "jail": - return nil, fmt.Errorf("jail driver not yet supported on FreeBSD") - } - return nil, fmt.Errorf("unknown exec driver %s", name) +func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { + return nil, fmt.Errorf("jail driver not yet supported on FreeBSD") } diff --git a/daemon/execdriver/execdrivers/execdrivers_linux.go b/daemon/execdriver/execdrivers/execdrivers_linux.go index 2a708a8310..b3ac97bc68 100644 --- a/daemon/execdriver/execdrivers/execdrivers_linux.go +++ b/daemon/execdriver/execdrivers/execdrivers_linux.go @@ -3,7 +3,6 @@ package execdrivers import ( - "fmt" "path" "github.com/docker/docker/daemon/execdriver" @@ -12,9 +11,6 @@ import ( ) // NewDriver returns a new execdriver.Driver from the given name configured with the provided options. -func NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { - if name != "native" { - return nil, fmt.Errorf("unknown exec driver %s", name) - } +func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { return native.NewDriver(path.Join(root, "execdriver", "native"), initPath, options) } diff --git a/daemon/execdriver/execdrivers/execdrivers_windows.go b/daemon/execdriver/execdrivers/execdrivers_windows.go index a043ff7b0b..688078b906 100644 --- a/daemon/execdriver/execdrivers/execdrivers_windows.go +++ b/daemon/execdriver/execdrivers/execdrivers_windows.go @@ -3,18 +3,12 @@ package execdrivers import ( - "fmt" - "github.com/docker/docker/daemon/execdriver" "github.com/docker/docker/daemon/execdriver/windows" "github.com/docker/docker/pkg/sysinfo" ) // NewDriver returns a new execdriver.Driver from the given name configured with the provided options. -func NewDriver(name string, options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { - switch name { - case "windows": - return windows.NewDriver(root, initPath, options) - } - return nil, fmt.Errorf("unknown exec driver %s", name) +func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) { + return windows.NewDriver(root, initPath, options) } diff --git a/daemon/inspect.go b/daemon/inspect.go index d75e085c80..3107b3bd55 100644 --- a/daemon/inspect.go +++ b/daemon/inspect.go @@ -128,7 +128,6 @@ func (daemon *Daemon) getInspectData(container *Container, size bool) (*types.Co Name: container.Name, RestartCount: container.RestartCount, Driver: container.Driver, - ExecDriver: container.ExecDriver, MountLabel: container.MountLabel, ProcessLabel: container.ProcessLabel, ExecIDs: container.getExecIDs(), diff --git a/docs/reference/api/docker_remote_api_v1.22.md b/docs/reference/api/docker_remote_api_v1.22.md index f1a076f09d..f11b242afa 100644 --- a/docs/reference/api/docker_remote_api_v1.22.md +++ b/docs/reference/api/docker_remote_api_v1.22.md @@ -672,8 +672,6 @@ Status Codes: This endpoint returns a live stream of a container's resource usage statistics. -> **Note**: this functionality currently only works when using the *libcontainer* exec-driver. - **Example request**: GET /containers/redis1/stats HTTP/1.1 diff --git a/docs/reference/commandline/daemon.md b/docs/reference/commandline/daemon.md index 6da89e6b49..8e3200d0ac 100644 --- a/docs/reference/commandline/daemon.md +++ b/docs/reference/commandline/daemon.md @@ -29,7 +29,6 @@ weight = -1 --dns-opt=[] DNS options to use --dns-search=[] DNS search domains to use --default-ulimit=[] Set default ulimit settings for containers - -e, --exec-driver="native" Exec driver to use --exec-opt=[] Set exec driver options --exec-root="/var/run/docker" Root of the Docker execdriver --fixed-cidr="" IPv4 subnet for fixed IPs diff --git a/hack/make/.integration-daemon-start b/hack/make/.integration-daemon-start index 0882d510ee..b02a3f4639 100644 --- a/hack/make/.integration-daemon-start +++ b/hack/make/.integration-daemon-start @@ -13,7 +13,6 @@ fi exec 41>&1 42>&2 export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs} -export DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native} export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true} # example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G" @@ -49,7 +48,6 @@ if [ -z "$DOCKER_TEST_HOST" ]; then docker daemon --debug \ --host "$DOCKER_HOST" \ --storage-driver "$DOCKER_GRAPHDRIVER" \ - --exec-driver "$DOCKER_EXECDRIVER" \ --pidfile "$DEST/docker.pid" \ --userland-proxy="$DOCKER_USERLANDPROXY" \ $storage_params \ diff --git a/integration-cli/docker_api_exec_resize_test.go b/integration-cli/docker_api_exec_resize_test.go index c44afdc1c1..2c0c8766ca 100644 --- a/integration-cli/docker_api_exec_resize_test.go +++ b/integration-cli/docker_api_exec_resize_test.go @@ -27,7 +27,6 @@ func (s *DockerSuite) TestExecResizeApiHeightWidthNoInt(c *check.C) { // Part of #14845 func (s *DockerSuite) TestExecResizeImmediatelyAfterExecStart(c *check.C) { testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) name := "exec_resize_test" dockerCmd(c, "run", "-d", "-i", "-t", "--name", name, "--restart", "always", "busybox", "/bin/sh") diff --git a/integration-cli/docker_api_inspect_test.go b/integration-cli/docker_api_inspect_test.go index bf31adcff3..defd3b277d 100644 --- a/integration-cli/docker_api_inspect_test.go +++ b/integration-cli/docker_api_inspect_test.go @@ -18,7 +18,7 @@ func (s *DockerSuite) TestInspectApiContainerResponse(c *check.C) { cleanedContainerID := strings.TrimSpace(out) keysBase := []string{"Id", "State", "Created", "Path", "Args", "Config", "Image", "NetworkSettings", - "ResolvConfPath", "HostnamePath", "HostsPath", "LogPath", "Name", "Driver", "ExecDriver", "MountLabel", "ProcessLabel", "GraphDriver"} + "ResolvConfPath", "HostnamePath", "HostsPath", "LogPath", "Name", "Driver", "MountLabel", "ProcessLabel", "GraphDriver"} cases := []struct { version string diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index b5cd181d6a..7053fb4fd7 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -5459,7 +5459,6 @@ func (s *DockerSuite) TestBuildEmptyStringVolume(c *check.C) { } func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) { - testRequires(c, NativeExecDriver) testRequires(c, SameHostDaemon) testRequires(c, DaemonIsLinux) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index d344ef68a4..fb8b2d5366 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -870,7 +870,7 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4ExplicitOutsideContainer } func (s *DockerDaemonSuite) TestDaemonDefaultNetworkInvalidClusterConfig(c *check.C) { - testRequires(c, SameHostDaemon) + testRequires(c, DaemonIsLinux, SameHostDaemon) // Start daemon without docker0 bridge defaultNetworkBridge := "docker0" @@ -1032,7 +1032,7 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *che } func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *check.C) { - testRequires(c, NativeExecDriver) + testRequires(c, DaemonIsLinux) if err := s.d.StartWithBusybox("--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024"); err != nil { c.Fatal(err) @@ -1527,7 +1527,7 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterCrash(c *check.C) { } func (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) { - testRequires(c, NativeExecDriver, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) c.Assert(s.d.StartWithBusybox("-b", "none"), check.IsNil) out, err := s.d.Cmd("run", "--rm", "busybox", "ip", "l") diff --git a/integration-cli/docker_cli_events_unix_test.go b/integration-cli/docker_cli_events_unix_test.go index 6c72b37484..b45620fdf0 100644 --- a/integration-cli/docker_cli_events_unix_test.go +++ b/integration-cli/docker_cli_events_unix_test.go @@ -47,7 +47,6 @@ func (s *DockerSuite) TestEventsRedirectStdout(c *check.C) { func (s *DockerSuite) TestEventsOOMDisableFalse(c *check.C) { testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) testRequires(c, oomControl) testRequires(c, NotGCCGO) @@ -84,7 +83,6 @@ func (s *DockerSuite) TestEventsOOMDisableFalse(c *check.C) { func (s *DockerSuite) TestEventsOOMDisableTrue(c *check.C) { testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) testRequires(c, oomControl) testRequires(c, NotGCCGO) diff --git a/integration-cli/docker_cli_experimental_test.go b/integration-cli/docker_cli_experimental_test.go index 39b3b5c3f8..4c2384912a 100644 --- a/integration-cli/docker_cli_experimental_test.go +++ b/integration-cli/docker_cli_experimental_test.go @@ -32,8 +32,7 @@ func (s *DockerSuite) TestExperimentalVersion(c *check.C) { // 1. validate uid/gid maps are set properly // 2. verify that files created are owned by remapped root func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) { - testRequires(c, NativeExecDriver) - testRequires(c, SameHostDaemon) + testRequires(c, DaemonIsLinux, SameHostDaemon) c.Assert(s.d.StartWithBusybox("--userns-remap", "default"), checker.IsNil) diff --git a/integration-cli/docker_cli_nat_test.go b/integration-cli/docker_cli_nat_test.go index 835194b74a..fc360242c8 100644 --- a/integration-cli/docker_cli_nat_test.go +++ b/integration-cli/docker_cli_nat_test.go @@ -50,8 +50,7 @@ func getContainerStatus(c *check.C, containerID string) string { } func (s *DockerSuite) TestNetworkNat(c *check.C) { - testRequires(c, DaemonIsLinux) - testRequires(c, SameHostDaemon, NativeExecDriver) + testRequires(c, DaemonIsLinux, SameHostDaemon) msg := "it works" startServerContainer(c, msg, 8080) endpoint := getExternalAddress(c) @@ -67,8 +66,7 @@ func (s *DockerSuite) TestNetworkNat(c *check.C) { } func (s *DockerSuite) TestNetworkLocalhostTCPNat(c *check.C) { - testRequires(c, DaemonIsLinux) - testRequires(c, SameHostDaemon, NativeExecDriver) + testRequires(c, DaemonIsLinux, SameHostDaemon) var ( msg = "hi yall" ) @@ -85,8 +83,7 @@ func (s *DockerSuite) TestNetworkLocalhostTCPNat(c *check.C) { } func (s *DockerSuite) TestNetworkLoopbackNat(c *check.C) { - testRequires(c, DaemonIsLinux) - testRequires(c, SameHostDaemon, NativeExecDriver, NotUserNamespace) + testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace) msg := "it works" startServerContainer(c, msg, 8080) endpoint := getExternalAddress(c) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index d9fe01ba4c..e2182f3c8c 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -259,7 +259,7 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) { if daemonPlatform == "windows" { testRequires(c, SameHostDaemon, WindowsDaemonSupportsVolumes) } else { - testRequires(c, SameHostDaemon, NativeExecDriver) + testRequires(c, SameHostDaemon) } name := "test-volume-symlink" @@ -923,7 +923,7 @@ func (s *DockerSuite) TestRunCapAddALLDropNetAdminCanDownInterface(c *check.C) { func (s *DockerSuite) TestRunGroupAdd(c *check.C) { // Not applicable for Windows as there is no concept of --group-add - testRequires(c, DaemonIsLinux, NativeExecDriver) + testRequires(c, DaemonIsLinux) out, _ := dockerCmd(c, "run", "--group-add=audio", "--group-add=staff", "--group-add=777", "busybox", "sh", "-c", "id") groupsList := "uid=0(root) gid=0(root) groups=10(wheel),29(audio),50(staff),777" @@ -1280,7 +1280,7 @@ func (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) { // uses the host's /etc/resolv.conf and does not have any dns options provided. func (s *DockerSuite) TestRunResolvconfUpdate(c *check.C) { // Not applicable on Windows as testing unix specific functionality - testRequires(c, SameHostDaemon, DaemonIsLinux, NativeExecDriver) + testRequires(c, SameHostDaemon, DaemonIsLinux) tmpResolvConf := []byte("search pommesfrites.fr\nnameserver 12.34.56.78\n") tmpLocalhostResolvConf := []byte("nameserver 127.0.0.1") @@ -2240,9 +2240,6 @@ func (s *DockerSuite) TestRunExposePort(c *check.C) { } func (s *DockerSuite) TestRunUnknownCommand(c *check.C) { - if daemonPlatform != "windows" { - testRequires(c, NativeExecDriver) - } out, _, _ := dockerCmdWithStdoutStderr(c, "create", "busybox", "/bin/nada") cID := strings.TrimSpace(out) @@ -2384,7 +2381,7 @@ func (s *DockerSuite) TestContainerNetworkMode(c *check.C) { func (s *DockerSuite) TestRunModePidHost(c *check.C) { // Not applicable on Windows as uses Unix-specific capabilities - testRequires(c, NativeExecDriver, SameHostDaemon, DaemonIsLinux, NotUserNamespace) + testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace) hostPid, err := os.Readlink("/proc/1/ns/pid") if err != nil { @@ -2406,7 +2403,7 @@ func (s *DockerSuite) TestRunModePidHost(c *check.C) { func (s *DockerSuite) TestRunModeUTSHost(c *check.C) { // Not applicable on Windows as uses Unix-specific capabilities - testRequires(c, NativeExecDriver, SameHostDaemon, DaemonIsLinux) + testRequires(c, SameHostDaemon, DaemonIsLinux) hostUTS, err := os.Readlink("/proc/1/ns/uts") if err != nil { @@ -2636,7 +2633,7 @@ func (s *DockerSuite) TestRunContainerWithWritableRootfs(c *check.C) { func (s *DockerSuite) TestRunContainerWithReadonlyRootfs(c *check.C) { // Not applicable on Windows which does not support --read-only - testRequires(c, NativeExecDriver, DaemonIsLinux) + testRequires(c, DaemonIsLinux) for _, f := range []string{"/file", "/etc/hosts", "/etc/resolv.conf", "/etc/hostname", "/sys/kernel", "/dev/.dont.touch.me"} { testReadOnlyFile(f, c) @@ -2647,7 +2644,7 @@ func (s *DockerSuite) TestPermissionsPtsReadonlyRootfs(c *check.C) { // Not applicable on Windows due to use of Unix specific functionality, plus // the use of --read-only which is not supported. // --read-only + userns has remount issues - testRequires(c, DaemonIsLinux, NativeExecDriver, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) // Ensure we have not broken writing /dev/pts out, status := dockerCmd(c, "run", "--read-only", "--rm", "busybox", "mount") @@ -2662,7 +2659,7 @@ func (s *DockerSuite) TestPermissionsPtsReadonlyRootfs(c *check.C) { func testReadOnlyFile(filename string, c *check.C) { // Not applicable on Windows which does not support --read-only - testRequires(c, NativeExecDriver, DaemonIsLinux, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) out, _, err := dockerCmdWithError("run", "--read-only", "--rm", "busybox", "touch", filename) if err == nil { @@ -2686,7 +2683,7 @@ func testReadOnlyFile(filename string, c *check.C) { func (s *DockerSuite) TestRunContainerWithReadonlyEtcHostsAndLinkedContainer(c *check.C) { // Not applicable on Windows which does not support --link // --read-only + userns has remount issues - testRequires(c, NativeExecDriver, DaemonIsLinux, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) dockerCmd(c, "run", "-d", "--name", "test-etc-hosts-ro-linked", "busybox", "top") @@ -2699,7 +2696,7 @@ func (s *DockerSuite) TestRunContainerWithReadonlyEtcHostsAndLinkedContainer(c * func (s *DockerSuite) TestRunContainerWithReadonlyRootfsWithDnsFlag(c *check.C) { // Not applicable on Windows which does not support either --read-only or --dns. // --read-only + userns has remount issues - testRequires(c, NativeExecDriver, DaemonIsLinux, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) out, _ := dockerCmd(c, "run", "--read-only", "--dns", "1.1.1.1", "busybox", "/bin/cat", "/etc/resolv.conf") if !strings.Contains(string(out), "1.1.1.1") { @@ -2710,7 +2707,7 @@ func (s *DockerSuite) TestRunContainerWithReadonlyRootfsWithDnsFlag(c *check.C) func (s *DockerSuite) TestRunContainerWithReadonlyRootfsWithAddHostFlag(c *check.C) { // Not applicable on Windows which does not support --read-only // --read-only + userns has remount issues - testRequires(c, NativeExecDriver, DaemonIsLinux, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) out, _ := dockerCmd(c, "run", "--read-only", "--add-host", "testreadonly:127.0.0.1", "busybox", "/bin/cat", "/etc/hosts") if !strings.Contains(string(out), "testreadonly") { @@ -2815,7 +2812,7 @@ func (s *DockerSuite) TestRunWriteToProcAsound(c *check.C) { func (s *DockerSuite) TestRunReadProcTimer(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, NativeExecDriver, DaemonIsLinux) + testRequires(c, DaemonIsLinux) out, code, err := dockerCmdWithError("run", "busybox", "cat", "/proc/timer_stats") if code != 0 { return @@ -2830,7 +2827,7 @@ func (s *DockerSuite) TestRunReadProcTimer(c *check.C) { func (s *DockerSuite) TestRunReadProcLatency(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, NativeExecDriver, DaemonIsLinux) + testRequires(c, DaemonIsLinux) // some kernels don't have this configured so skip the test if this file is not found // on the host running the tests. if _, err := os.Stat("/proc/latency_stats"); err != nil { @@ -2875,7 +2872,6 @@ func (s *DockerSuite) TestRunReadFilteredProc(c *check.C) { func (s *DockerSuite) TestMountIntoProc(c *check.C) { // Not applicable on Windows as uses Unix specific functionality testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) _, code, err := dockerCmdWithError("run", "-v", "/proc//sys", "busybox", "true") if err == nil || code == 0 { c.Fatal("container should not be able to mount into /proc") @@ -2885,7 +2881,7 @@ func (s *DockerSuite) TestMountIntoProc(c *check.C) { func (s *DockerSuite) TestMountIntoSys(c *check.C) { // Not applicable on Windows as uses Unix specific functionality testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver, NotUserNamespace) + testRequires(c, NotUserNamespace) dockerCmd(c, "run", "-v", "/sys/fs/cgroup", "busybox", "true") } @@ -2893,7 +2889,7 @@ func (s *DockerSuite) TestRunUnshareProc(c *check.C) { c.Skip("unstable test: is apparmor in a container reliable?") // Not applicable on Windows as uses Unix specific functionality - testRequires(c, Apparmor, NativeExecDriver, DaemonIsLinux) + testRequires(c, Apparmor, DaemonIsLinux) name := "acidburn" if out, _, err := dockerCmdWithError("run", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount"); err == nil || !strings.Contains(out, "Permission denied") { @@ -2927,7 +2923,6 @@ func (s *DockerSuite) TestRunPublishPort(c *check.C) { func (s *DockerSuite) TestDevicePermissions(c *check.C) { // Not applicable on Windows as uses Unix specific functionality testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) const permissions = "crw-rw-rw-" out, status := dockerCmd(c, "run", "--device", "/dev/fuse:/dev/fuse:mrw", "busybox:latest", "ls", "-l", "/dev/fuse") if status != 0 { @@ -2941,7 +2936,6 @@ func (s *DockerSuite) TestDevicePermissions(c *check.C) { func (s *DockerSuite) TestRunCapAddCHOWN(c *check.C) { // Not applicable on Windows as uses Unix specific functionality testRequires(c, DaemonIsLinux) - testRequires(c, NativeExecDriver) out, _ := dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=CHOWN", "busybox", "sh", "-c", "adduser -D -H newuser && chown newuser /home && echo ok") if actual := strings.Trim(out, "\r\n"); actual != "ok" { @@ -2984,7 +2978,7 @@ func (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) { func (s *DockerSuite) TestRunWriteFilteredProc(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, Apparmor, NativeExecDriver, DaemonIsLinux, NotUserNamespace) + testRequires(c, Apparmor, DaemonIsLinux, NotUserNamespace) testWritePaths := []string{ /* modprobe and core_pattern should both be denied by generic @@ -3253,7 +3247,7 @@ func (s *DockerSuite) TestPtraceContainerProcsFromHost(c *check.C) { func (s *DockerSuite) TestAppArmorDeniesPtrace(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, SameHostDaemon, NativeExecDriver, Apparmor, DaemonIsLinux, NotGCCGO) + testRequires(c, SameHostDaemon, Apparmor, DaemonIsLinux, NotGCCGO) // Run through 'sh' so we are NOT pid 1. Pid 1 may be able to trace // itself, but pid>1 should not be able to trace pid1. @@ -3277,7 +3271,7 @@ func (s *DockerSuite) TestAppArmorDeniesChmodProc(c *check.C) { c.Skip("Test is failing, and what it tests is unclear") // Not applicable on Windows as uses Unix specific functionality - testRequires(c, SameHostDaemon, NativeExecDriver, Apparmor, DaemonIsLinux) + testRequires(c, SameHostDaemon, Apparmor, DaemonIsLinux) _, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "744", "/proc/cpuinfo") if exitCode == 0 { // If our test failed, attempt to repair the host system... @@ -3290,7 +3284,7 @@ func (s *DockerSuite) TestAppArmorDeniesChmodProc(c *check.C) { func (s *DockerSuite) TestRunCapAddSYSTIME(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, DaemonIsLinux, NativeExecDriver) + testRequires(c, DaemonIsLinux) dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=SYS_TIME", "busybox", "sh", "-c", "grep ^CapEff /proc/self/status | sed 's/^CapEff:\t//' | grep ^0000000002000000$") } @@ -3327,7 +3321,7 @@ func (s *DockerSuite) TestRunNamedVolume(c *check.C) { func (s *DockerSuite) TestRunWithUlimits(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, DaemonIsLinux, NativeExecDriver) + testRequires(c, DaemonIsLinux) out, _ := dockerCmd(c, "run", "--name=testulimits", "--ulimit", "nofile=42", "busybox", "/bin/sh", "-c", "ulimit -n") ul := strings.TrimSpace(out) @@ -3338,7 +3332,7 @@ func (s *DockerSuite) TestRunWithUlimits(c *check.C) { func (s *DockerSuite) TestRunContainerWithCgroupParent(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, DaemonIsLinux, NativeExecDriver) + testRequires(c, DaemonIsLinux) cgroupParent := "test" name := "cgroup-test" @@ -3368,7 +3362,7 @@ func (s *DockerSuite) TestRunContainerWithCgroupParent(c *check.C) { func (s *DockerSuite) TestRunContainerWithCgroupParentAbsPath(c *check.C) { // Not applicable on Windows as uses Unix specific functionality - testRequires(c, DaemonIsLinux, NativeExecDriver) + testRequires(c, DaemonIsLinux) cgroupParent := "/cgroup-parent/test" name := "cgroup-test" @@ -3398,7 +3392,7 @@ func (s *DockerSuite) TestRunContainerWithCgroupParentAbsPath(c *check.C) { func (s *DockerSuite) TestRunContainerWithCgroupMountRO(c *check.C) { // Not applicable on Windows as uses Unix specific functionality // --read-only + userns has remount issues - testRequires(c, DaemonIsLinux, NativeExecDriver, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) filename := "/sys/fs/cgroup/devices/test123" out, _, err := dockerCmdWithError("run", "busybox", "touch", filename) @@ -3553,7 +3547,7 @@ func (s *DockerSuite) TestContainersInUserDefinedNetwork(c *check.C) { } func (s *DockerSuite) TestContainersInMultipleNetworks(c *check.C) { - testRequires(c, DaemonIsLinux, NotUserNamespace, NativeExecDriver) + testRequires(c, DaemonIsLinux, NotUserNamespace) // Create 2 networks using bridge driver dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork1") dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork2") @@ -3572,7 +3566,7 @@ func (s *DockerSuite) TestContainersInMultipleNetworks(c *check.C) { } func (s *DockerSuite) TestContainersNetworkIsolation(c *check.C) { - testRequires(c, DaemonIsLinux, NotUserNamespace, NativeExecDriver) + testRequires(c, DaemonIsLinux, NotUserNamespace) // Create 2 networks using bridge driver dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork1") dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork2") @@ -3617,7 +3611,7 @@ func (s *DockerSuite) TestNetworkRmWithActiveContainers(c *check.C) { } func (s *DockerSuite) TestContainerRestartInMultipleNetworks(c *check.C) { - testRequires(c, DaemonIsLinux, NotUserNamespace, NativeExecDriver) + testRequires(c, DaemonIsLinux, NotUserNamespace) // Create 2 networks using bridge driver dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork1") dockerCmd(c, "network", "create", "-d", "bridge", "testnetwork2") diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 5747e471e4..31b14f515d 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -92,7 +92,7 @@ func (s *DockerSuite) TestRunWithVolumesIsRecursive(c *check.C) { } func (s *DockerSuite) TestRunDeviceDirectory(c *check.C) { - testRequires(c, NativeExecDriver, NotUserNamespace) + testRequires(c, DaemonIsLinux, NotUserNamespace) if _, err := os.Stat("/dev/snd"); err != nil { c.Skip("Host does not have /dev/snd") } @@ -314,7 +314,7 @@ func (s *DockerSuite) TestRunEchoStdoutWithMemoryLimit(c *check.C) { // 16M memory and as much swap memory as they need (if the host // supports swap memory). func (s *DockerSuite) TestRunWithoutMemoryswapLimit(c *check.C) { - testRequires(c, NativeExecDriver) + testRequires(c, DaemonIsLinux) testRequires(c, memoryLimitSupport) testRequires(c, swapMemorySupport) dockerCmd(c, "run", "-m", "16m", "--memory-swap", "-1", "busybox", "true") @@ -420,7 +420,7 @@ func (s *DockerSuite) TestRunInvalidCpusetMemsFlagValue(c *check.C) { } func (s *DockerSuite) TestRunInvalidCPUShares(c *check.C) { - testRequires(c, cpuShare, NativeExecDriver) + testRequires(c, cpuShare, DaemonIsLinux) out, _, err := dockerCmdWithError("run", "--cpu-shares", "1", "busybox", "echo", "test") c.Assert(err, check.NotNil, check.Commentf(out)) expected := "The minimum allowed cpu-shares is 2" diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index 5540b792d7..7974566e87 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -229,9 +229,6 @@ func (d *Daemon) Start(arg ...string) error { if d.storageDriver != "" { args = append(args, "--storage-driver", d.storageDriver) } - if d.execDriver != "" { - args = append(args, "--exec-driver", d.execDriver) - } args = append(args, arg...) d.cmd = exec.Command(dockerBinary, args...) diff --git a/integration-cli/requirements.go b/integration-cli/requirements.go index 20a693e6b9..e70fcaf143 100644 --- a/integration-cli/requirements.go +++ b/integration-cli/requirements.go @@ -1,10 +1,8 @@ package main import ( - "encoding/json" "fmt" "io/ioutil" - "log" "net/http" "os" "os/exec" @@ -23,8 +21,6 @@ type testRequirement struct { // List test requirements var ( - daemonExecDriver string - DaemonIsWindows = testRequirement{ func() bool { return daemonPlatform == "windows" }, "Test requires a Windows daemon", @@ -105,30 +101,6 @@ var ( }, fmt.Sprintf("Test requires an environment that can host %s in the same host", notaryBinary), } - NativeExecDriver = testRequirement{ - func() bool { - if daemonExecDriver == "" { - // get daemon info - status, body, err := sockRequest("GET", "/info", nil) - if err != nil || status != http.StatusOK { - log.Fatalf("sockRequest failed for /info: %v", err) - } - - type infoJSON struct { - ExecutionDriver string - } - var info infoJSON - if err = json.Unmarshal(body, &info); err != nil { - log.Fatalf("unable to unmarshal body: %v", err) - } - - daemonExecDriver = info.ExecutionDriver - } - - return strings.HasPrefix(daemonExecDriver, "native") - }, - "Test requires the native (libcontainer) exec driver.", - } NotOverlay = testRequirement{ func() bool { cmd := exec.Command("grep", "^overlay / overlay", "/proc/mounts") diff --git a/man/docker-daemon.8.md b/man/docker-daemon.8.md index b85a9a76fa..c16d4d352a 100644 --- a/man/docker-daemon.8.md +++ b/man/docker-daemon.8.md @@ -20,7 +20,6 @@ docker-daemon - Enable daemon mode [**--dns**[=*[]*]] [**--dns-opt**[=*[]*]] [**--dns-search**[=*[]*]] -[**-e**|**--exec-driver**[=*native*]] [**--exec-opt**[=*[]*]] [**--exec-root**[=*/var/run/docker*]] [**--fixed-cidr**[=*FIXED-CIDR*]] @@ -112,9 +111,6 @@ format. **--dns-search**=[] DNS search domains to use. -**-e**, **--exec-driver**="" - Force Docker to use specific exec driver. Default is `native`. - **--exec-opt**=[] Set exec driver options. See EXEC DRIVER OPTIONS. diff --git a/man/docker.1.md b/man/docker.1.md index 18df3b5cf2..eaed589df7 100644 --- a/man/docker.1.md +++ b/man/docker.1.md @@ -225,8 +225,8 @@ inside it) # EXEC DRIVER OPTIONS -Use the **--exec-opt** flags to specify options to the exec-driver. The only -driver that accepts this flag is the *native* (libcontainer) driver. As a +Use the **--exec-opt** flags to specify options to the execution driver. The only +runtime that accepts any options is Linux. As a result, you must also specify **-s=**native for this option to have effect. The following is the only *native* option: