2015-04-24 18:36:11 -04:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2015-07-13 15:34:58 -04:00
|
|
|
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
2015-04-24 18:36:11 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
|
|
|
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
2015-05-26 19:17:33 -04:00
|
|
|
defaultExec = "windows"
|
2015-04-24 18:36:11 -04:00
|
|
|
)
|
|
|
|
|
2015-07-13 15:34:58 -04:00
|
|
|
// bridgeConfig stores all the bridge driver specific
|
|
|
|
// configuration.
|
|
|
|
type bridgeConfig struct {
|
|
|
|
VirtualSwitchName string
|
|
|
|
}
|
|
|
|
|
2015-04-24 18:36:11 -04:00
|
|
|
// Config defines the configuration of a docker daemon.
|
|
|
|
// These are the configuration settings that you pass
|
2015-08-10 08:48:08 -04:00
|
|
|
// to the docker daemon when you launch it with say: `docker daemon -e windows`
|
2015-04-24 18:36:11 -04: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 00:18:28 -04:00
|
|
|
func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) string) {
|
2015-04-24 18:36:11 -04:00
|
|
|
// First handle install flags which are consistent cross-platform
|
2015-05-05 00:18:28 -04:00
|
|
|
config.InstallCommonFlags(cmd, usageFn)
|
2015-04-24 18:36:11 -04:00
|
|
|
|
2015-07-13 15:34:58 -04:00
|
|
|
// Then platform-specific install flags.
|
2015-07-24 15:30:49 -04:00
|
|
|
cmd.StringVar(&config.Bridge.VirtualSwitchName, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
|
2015-04-24 18:36:11 -04:00
|
|
|
}
|