2015-04-24 18:36:11 -04:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2015-07-13 15:34:58 -04:00
|
|
|
|
2016-09-06 14:18:12 -04:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-06-22 18:36:51 -04:00
|
|
|
"github.com/spf13/pflag"
|
2015-04-24 18:36:11 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2016-03-24 14:42:03 -04:00
|
|
|
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
|
|
|
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
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 {
|
2016-03-28 14:55:20 -04:00
|
|
|
commonBridgeConfig
|
2015-07-13 15:34:58 -04:00
|
|
|
}
|
|
|
|
|
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.)
|
|
|
|
}
|
|
|
|
|
2016-06-22 18:36:51 -04:00
|
|
|
// InstallFlags adds flags to the pflag.FlagSet to configure the daemon
|
|
|
|
func (config *Config) InstallFlags(flags *pflag.FlagSet) {
|
2015-04-24 18:36:11 -04:00
|
|
|
// First handle install flags which are consistent cross-platform
|
2016-06-22 18:36:51 -04:00
|
|
|
config.InstallCommonFlags(flags)
|
2015-04-24 18:36:11 -04:00
|
|
|
|
2015-07-13 15:34:58 -04:00
|
|
|
// Then platform-specific install flags.
|
2016-06-22 18:36:51 -04:00
|
|
|
flags.StringVar(&config.bridgeConfig.FixedCIDR, "fixed-cidr", "", "IPv4 subnet for fixed IPs")
|
|
|
|
flags.StringVarP(&config.bridgeConfig.Iface, "bridge", "b", "", "Attach containers to a virtual switch")
|
|
|
|
flags.StringVarP(&config.SocketGroup, "group", "G", "", "Users or groups that can access the named pipe")
|
2015-04-24 18:36:11 -04:00
|
|
|
}
|
2016-05-23 17:49:50 -04: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 15:14:27 -04:00
|
|
|
return stockRuntimeName
|
2016-05-23 17:49:50 -04: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 12:13:53 -04:00
|
|
|
|
2016-07-21 19:13:10 -04:00
|
|
|
// GetExecRoot returns the user configured Exec-root
|
|
|
|
func (config *Config) GetExecRoot() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2016-06-14 12:13:53 -04:00
|
|
|
func (config *Config) isSwarmCompatible() error {
|
|
|
|
return nil
|
|
|
|
}
|