Browse code

root dir for execdriver (/var/run/docker) should be configurable

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Shishir Mahajan authored on 2015/05/15 11:59:11
Showing 5 changed files
... ...
@@ -1161,6 +1161,7 @@ _docker() {
1161 1161
 		--dns-search
1162 1162
 		--exec-driver -e
1163 1163
 		--exec-opt
1164
+		--exec-root
1164 1165
 		--fixed-cidr
1165 1166
 		--fixed-cidr-v6
1166 1167
 		--graph -g
... ...
@@ -25,6 +25,7 @@ type CommonConfig struct {
25 25
 	DnsSearch      []string
26 26
 	EnableCors     bool
27 27
 	ExecDriver     string
28
+	ExecRoot       string
28 29
 	GraphDriver    string
29 30
 	Labels         []string
30 31
 	LogConfig      runconfig.LogConfig
... ...
@@ -38,9 +39,11 @@ type CommonConfig struct {
38 38
 // the current process.
39 39
 // Subsequent calls to `flag.Parse` will populate config with values parsed
40 40
 // from the command-line.
41
+
41 42
 func (config *Config) InstallCommonFlags() {
42 43
 	flag.StringVar(&config.Pidfile, []string{"p", "-pidfile"}, defaultPidFile, "Path to use for daemon PID file")
43 44
 	flag.StringVar(&config.Root, []string{"g", "-graph"}, defaultGraph, "Root of the Docker runtime")
45
+	flag.StringVar(&config.ExecRoot, []string{"-exec-root"}, "/var/run/docker", "Root of the Docker execdriver")
44 46
 	flag.BoolVar(&config.AutoRestart, []string{"#r", "#-restart"}, true, "--restart on the daemon has been deprecated in favor of --restart policies on docker run")
45 47
 	flag.BoolVar(&config.Bridge.EnableIptables, []string{"#iptables", "-iptables"}, true, "Enable addition of iptables rules")
46 48
 	flag.BoolVar(&config.Bridge.EnableIpForward, []string{"#ip-forward", "-ip-forward"}, true, "Enable net.ipv4.ip_forward")
... ...
@@ -911,8 +911,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
911 911
 	}
912 912
 
913 913
 	sysInfo := sysinfo.New(false)
914
-	const runDir = "/var/run/docker"
915
-	ed, err := execdrivers.NewDriver(config.ExecDriver, config.ExecOptions, runDir, config.Root, sysInitPath, sysInfo)
914
+	ed, err := execdrivers.NewDriver(config.ExecDriver, config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo)
916 915
 	if err != nil {
917 916
 		return nil, err
918 917
 	}
... ...
@@ -56,6 +56,9 @@ To see the man page for a command run **man docker <command>**.
56 56
 **--exec-opt**=[]
57 57
   Set exec driver options. See EXEC DRIVER OPTIONS.
58 58
 
59
+**--exec-root**=""
60
+  Path to use as the root of the Docker execdriver. Default is `/var/run/docker`.
61
+
59 62
 **--fixed-cidr**=""
60 63
   IPv4 subnet for fixed IPs (e.g., 10.20.0.0/16); this subnet must be nested in the bridge subnet (which is defined by \-b or \-\-bip)
61 64
 
... ...
@@ -152,6 +152,7 @@ expect an integer, and they can only be specified once.
152 152
       --default-ulimit=[]                    Set default ulimit settings for containers
153 153
       -e, --exec-driver="native"             Exec driver to use
154 154
       --exec-opt=[]                          Set exec driver options
155
+      --exec-root="/var/run/docker"          Root of the Docker execdriver
155 156
       --fixed-cidr=""                        IPv4 subnet for fixed IPs
156 157
       --fixed-cidr-v6=""                     IPv6 subnet for fixed IPs
157 158
       -G, --group="docker"                   Group for the unix socket