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"
|
2016-05-23 17:49:50 -04:00
|
|
|
"github.com/docker/engine-api/types"
|
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.)
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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.
|
2016-03-09 23:33:21 -05: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-30 21:45:49 -05:00
|
|
|
cmd.StringVar(&config.SocketGroup, []string{"G", "-group"}, "", usageFn("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 {
|
|
|
|
return types.DefaultRuntimeName
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
func (config *Config) isSwarmCompatible() error {
|
|
|
|
return nil
|
|
|
|
}
|