2015-04-24 22:36:11 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2015-07-13 19:34:58 +00:00
|
|
|
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
2016-05-23 21:49:50 +00:00
|
|
|
"github.com/docker/engine-api/types"
|
2015-04-24 22:36:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2016-03-24 18:42:03 +00:00
|
|
|
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
|
|
|
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
2015-04-24 22:36:11 +00:00
|
|
|
)
|
|
|
|
|
2015-07-13 19:34:58 +00:00
|
|
|
// bridgeConfig stores all the bridge driver specific
|
|
|
|
// configuration.
|
|
|
|
type bridgeConfig struct {
|
2016-03-28 18:55:20 +00:00
|
|
|
commonBridgeConfig
|
2015-07-13 19:34:58 +00:00
|
|
|
}
|
|
|
|
|
2015-04-24 22:36:11 +00:00
|
|
|
// Config defines the configuration of a docker daemon.
|
|
|
|
// These are the configuration settings that you pass
|
2015-08-10 12:48:08 +00:00
|
|
|
// to the docker daemon when you launch it with say: `docker daemon -e windows`
|
2015-04-24 22:36:11 +00: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 04:18:28 +00:00
|
|
|
func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) string) {
|
2015-04-24 22:36:11 +00:00
|
|
|
// First handle install flags which are consistent cross-platform
|
2015-05-05 04:18:28 +00:00
|
|
|
config.InstallCommonFlags(cmd, usageFn)
|
2015-04-24 22:36:11 +00:00
|
|
|
|
2015-07-13 19:34:58 +00:00
|
|
|
// Then platform-specific install flags.
|
2016-03-10 04:33:21 +00:00
|
|
|
cmd.StringVar(&config.bridgeConfig.FixedCIDR, []string{"-fixed-cidr"}, "", usageFn("IPv4 subnet for fixed IPs"))
|
|
|
|
cmd.StringVar(&config.bridgeConfig.Iface, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
|
2016-01-31 02:45:49 +00:00
|
|
|
cmd.StringVar(&config.SocketGroup, []string{"G", "-group"}, "", usageFn("Users or groups that can access the named pipe"))
|
2015-04-24 22:36:11 +00:00
|
|
|
}
|
2016-05-23 21:49:50 +00:00
|
|
|
|
|
|
|
// GetRuntime returns the runtime path and arguments for a given
|
|
|
|
// runtime name
|
|
|
|
func (config *Config) GetRuntime(name string) *types.Runtime {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetDefaultRuntimeName returns the current default runtime
|
|
|
|
func (config *Config) GetDefaultRuntimeName() string {
|
2016-06-20 19:14:27 +00:00
|
|
|
return stockRuntimeName
|
2016-05-23 21:49:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetAllRuntimes returns a copy of the runtimes map
|
|
|
|
func (config *Config) GetAllRuntimes() map[string]types.Runtime {
|
|
|
|
return map[string]types.Runtime{}
|
|
|
|
}
|
2016-06-14 16:13:53 +00:00
|
|
|
|
|
|
|
func (config *Config) isSwarmCompatible() error {
|
|
|
|
return nil
|
|
|
|
}
|