2015-04-25 01:36:11 +03:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2015-07-13 22:34:58 +03:00
|
|
|
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
2015-04-25 01:36:11 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
|
|
|
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
2015-05-27 02:17:33 +03:00
|
|
|
defaultExec = "windows"
|
2015-04-25 01:36:11 +03:00
|
|
|
)
|
|
|
|
|
2015-07-13 22:34:58 +03:00
|
|
|
// bridgeConfig stores all the bridge driver specific
|
|
|
|
// configuration.
|
|
|
|
type bridgeConfig struct {
|
|
|
|
VirtualSwitchName string
|
|
|
|
}
|
|
|
|
|
2015-04-25 01:36:11 +03:00
|
|
|
// Config defines the configuration of a docker daemon.
|
|
|
|
// These are the configuration settings that you pass
|
2015-08-10 15:48:08 +03:00
|
|
|
// to the docker daemon when you launch it with say: `docker daemon -e windows`
|
2015-04-25 01:36:11 +03:00
|
|
|
type Config struct {
|
|
|
|
CommonConfig
|
|
|
|
|
|
|
|
// Fields below here are platform specific. (There are none presently
|
|
|
|
// for the Windows daemon.)
|
|
|
|
}
|
|
|
|
|
|
|
|
// InstallFlags adds command-line options to the top-level flag parser for
|
|
|
|
// the current process.
|
|
|
|
// Subsequent calls to `flag.Parse` will populate config with values parsed
|
|
|
|
// from the command-line.
|
2015-05-05 07:18:28 +03:00
|
|
|
func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) string) {
|
2015-04-25 01:36:11 +03:00
|
|
|
// First handle install flags which are consistent cross-platform
|
2015-05-05 07:18:28 +03:00
|
|
|
config.InstallCommonFlags(cmd, usageFn)
|
2015-04-25 01:36:11 +03:00
|
|
|
|
2015-07-13 22:34:58 +03:00
|
|
|
// Then platform-specific install flags.
|
2015-07-24 22:30:49 +03:00
|
|
|
cmd.StringVar(&config.Bridge.VirtualSwitchName, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
|
2015-04-25 01:36:11 +03:00
|
|
|
}
|