2015-04-24 22:36:11 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2016-10-17 18:48:51 +00:00
|
|
|
"path/filepath"
|
2015-07-13 19:34:58 +00:00
|
|
|
|
2016-09-06 18:18:12 +00:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-06-22 22:36:51 +00:00
|
|
|
"github.com/spf13/pflag"
|
2015-04-24 22:36:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2016-10-17 18:48:51 +00:00
|
|
|
defaultPidFile string
|
|
|
|
defaultGraph = filepath.Join(os.Getenv("programdata"), "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.)
|
|
|
|
}
|
|
|
|
|
2016-06-22 22:36:51 +00:00
|
|
|
// InstallFlags adds flags to the pflag.FlagSet to configure the daemon
|
|
|
|
func (config *Config) InstallFlags(flags *pflag.FlagSet) {
|
2015-04-24 22:36:11 +00:00
|
|
|
// First handle install flags which are consistent cross-platform
|
2016-06-22 22:36:51 +00:00
|
|
|
config.InstallCommonFlags(flags)
|
2015-04-24 22:36:11 +00:00
|
|
|
|
2015-07-13 19:34:58 +00:00
|
|
|
// Then platform-specific install flags.
|
2016-06-22 22:36:51 +00: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 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
|
|
|
|
}
|
|
|
|
|
2016-10-24 22:18:58 +00:00
|
|
|
// GetInitPath returns the configure docker-init path
|
|
|
|
func (config *Config) GetInitPath() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2016-05-23 21:49:50 +00:00
|
|
|
// 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
|
|
|
|
2016-07-21 23:13:10 +00:00
|
|
|
// GetExecRoot returns the user configured Exec-root
|
|
|
|
func (config *Config) GetExecRoot() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2016-06-14 16:13:53 +00:00
|
|
|
func (config *Config) isSwarmCompatible() error {
|
|
|
|
return nil
|
|
|
|
}
|