mirror of https://github.com/docker/docs.git
Merge pull request #10453 from aidanhs/aphs-move-daemon-flags
Move daemon-only flags into the daemon config struct
This commit is contained in:
commit
04b0bf4c27
|
@ -37,6 +37,8 @@ type Config struct {
|
||||||
GraphOptions []string
|
GraphOptions []string
|
||||||
ExecDriver string
|
ExecDriver string
|
||||||
Mtu int
|
Mtu int
|
||||||
|
SocketGroup string
|
||||||
|
EnableCors bool
|
||||||
DisableNetwork bool
|
DisableNetwork bool
|
||||||
EnableSelinuxSupport bool
|
EnableSelinuxSupport bool
|
||||||
Context map[string][]string
|
Context map[string][]string
|
||||||
|
@ -65,6 +67,8 @@ func (config *Config) InstallFlags() {
|
||||||
flag.StringVar(&config.ExecDriver, []string{"e", "-exec-driver"}, "native", "Exec driver to use")
|
flag.StringVar(&config.ExecDriver, []string{"e", "-exec-driver"}, "native", "Exec driver to use")
|
||||||
flag.BoolVar(&config.EnableSelinuxSupport, []string{"-selinux-enabled"}, false, "Enable selinux support")
|
flag.BoolVar(&config.EnableSelinuxSupport, []string{"-selinux-enabled"}, false, "Enable selinux support")
|
||||||
flag.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, "Set the containers network MTU")
|
flag.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, "Set the containers network MTU")
|
||||||
|
flag.StringVar(&config.SocketGroup, []string{"G", "-group"}, "docker", "Group for the unix socket")
|
||||||
|
flag.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "-api-enable-cors"}, false, "Enable CORS headers in the remote API")
|
||||||
opts.IPVar(&config.DefaultIp, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports")
|
opts.IPVar(&config.DefaultIp, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports")
|
||||||
opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options")
|
opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options")
|
||||||
// FIXME: why the inconsistency between "hosts" and "sockets"?
|
// FIXME: why the inconsistency between "hosts" and "sockets"?
|
||||||
|
|
|
@ -130,9 +130,9 @@ func mainDaemon() {
|
||||||
// Serve api
|
// Serve api
|
||||||
job := eng.Job("serveapi", flHosts...)
|
job := eng.Job("serveapi", flHosts...)
|
||||||
job.SetenvBool("Logging", true)
|
job.SetenvBool("Logging", true)
|
||||||
job.SetenvBool("EnableCors", *flEnableCors)
|
job.SetenvBool("EnableCors", daemonCfg.EnableCors)
|
||||||
job.Setenv("Version", dockerversion.VERSION)
|
job.Setenv("Version", dockerversion.VERSION)
|
||||||
job.Setenv("SocketGroup", *flSocketGroup)
|
job.Setenv("SocketGroup", daemonCfg.SocketGroup)
|
||||||
|
|
||||||
job.SetenvBool("Tls", *flTls)
|
job.SetenvBool("Tls", *flTls)
|
||||||
job.SetenvBool("TlsVerify", *flTlsVerify)
|
job.SetenvBool("TlsVerify", *flTlsVerify)
|
||||||
|
|
|
@ -31,15 +31,13 @@ func getDaemonConfDir() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
flVersion = flag.Bool([]string{"v", "-version"}, false, "Print version information and quit")
|
flVersion = flag.Bool([]string{"v", "-version"}, false, "Print version information and quit")
|
||||||
flDaemon = flag.Bool([]string{"d", "-daemon"}, false, "Enable daemon mode")
|
flDaemon = flag.Bool([]string{"d", "-daemon"}, false, "Enable daemon mode")
|
||||||
flDebug = flag.Bool([]string{"D", "-debug"}, false, "Enable debug mode")
|
flDebug = flag.Bool([]string{"D", "-debug"}, false, "Enable debug mode")
|
||||||
flSocketGroup = flag.String([]string{"G", "-group"}, "docker", "Group for the unix socket")
|
flLogLevel = flag.String([]string{"l", "-log-level"}, "info", "Set the logging level")
|
||||||
flLogLevel = flag.String([]string{"l", "-log-level"}, "info", "Set the logging level")
|
flTls = flag.Bool([]string{"-tls"}, false, "Use TLS; implied by --tlsverify flag")
|
||||||
flEnableCors = flag.Bool([]string{"#api-enable-cors", "-api-enable-cors"}, false, "Enable CORS headers in the remote API")
|
flHelp = flag.Bool([]string{"h", "-help"}, false, "Print usage")
|
||||||
flTls = flag.Bool([]string{"-tls"}, false, "Use TLS; implied by --tlsverify flag")
|
flTlsVerify = flag.Bool([]string{"-tlsverify"}, dockerTlsVerify, "Use TLS and verify the remote")
|
||||||
flHelp = flag.Bool([]string{"h", "-help"}, false, "Print usage")
|
|
||||||
flTlsVerify = flag.Bool([]string{"-tlsverify"}, dockerTlsVerify, "Use TLS and verify the remote")
|
|
||||||
|
|
||||||
// these are initialized in init() below since their default values depend on dockerCertPath which isn't fully initialized until init() runs
|
// these are initialized in init() below since their default values depend on dockerCertPath which isn't fully initialized until init() runs
|
||||||
flTrustKey *string
|
flTrustKey *string
|
||||||
|
|
Loading…
Reference in New Issue