diff --git a/AUTHORS b/AUTHORS index 7c7ba52477..7506cd885c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,6 +29,7 @@ Dr Nic Williams Elias Probst Eric Hanchrow Evan Wies +Eric Myhre ezbercih Flavio Castelli Francisco Souza diff --git a/docker/docker.go b/docker/docker.go index 508bf6aa90..c508d8905e 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -30,6 +30,7 @@ func main() { flAutoRestart := flag.Bool("r", false, "Restart previously running containers") bridgeName := flag.String("b", "", "Attach containers to a pre-existing network bridge") pidfile := flag.String("p", "/var/run/docker.pid", "File containing process PID") + flGraphPath := flag.String("g", "/var/lib/docker", "Path to graph storage base dir.") flEnableCors := flag.Bool("api-enable-cors", false, "Enable CORS requests in the remote api.") flDns := flag.String("dns", "", "Set custom dns servers") flHosts := docker.ListOpts{fmt.Sprintf("tcp://%s:%d", docker.DEFAULTHTTPHOST, docker.DEFAULTHTTPPORT)} @@ -56,7 +57,7 @@ func main() { flag.Usage() return } - if err := daemon(*pidfile, flHosts, *flAutoRestart, *flEnableCors, *flDns); err != nil { + if err := daemon(*pidfile, *flGraphPath, flHosts, *flAutoRestart, *flEnableCors, *flDns); err != nil { log.Fatal(err) os.Exit(-1) } @@ -100,7 +101,7 @@ func removePidFile(pidfile string) { } } -func daemon(pidfile string, protoAddrs []string, autoRestart, enableCors bool, flDns string) error { +func daemon(pidfile string, flGraphPath string, protoAddrs []string, autoRestart, enableCors bool, flDns string) error { if err := createPidFile(pidfile); err != nil { log.Fatal(err) } @@ -118,7 +119,7 @@ func daemon(pidfile string, protoAddrs []string, autoRestart, enableCors bool, f if flDns != "" { dns = []string{flDns} } - server, err := docker.NewServer(autoRestart, enableCors, dns) + server, err := docker.NewServer(flGraphPath, autoRestart, enableCors, dns) if err != nil { return err } diff --git a/runtime.go b/runtime.go index c37e292d22..29f5067931 100644 --- a/runtime.go +++ b/runtime.go @@ -246,8 +246,8 @@ func (runtime *Runtime) UpdateCapabilities(quiet bool) { } // FIXME: harmonize with NewGraph() -func NewRuntime(autoRestart bool, dns []string) (*Runtime, error) { - runtime, err := NewRuntimeFromDirectory("/var/lib/docker", autoRestart) +func NewRuntime(flGraphPath string, autoRestart bool, dns []string) (*Runtime, error) { + runtime, err := NewRuntimeFromDirectory(flGraphPath, autoRestart) if err != nil { return nil, err } diff --git a/server.go b/server.go index 5fdfd00a49..ee023044a0 100644 --- a/server.go +++ b/server.go @@ -1049,11 +1049,11 @@ func (srv *Server) ImageInspect(name string) (*Image, error) { return nil, fmt.Errorf("No such image: %s", name) } -func NewServer(autoRestart, enableCors bool, dns ListOpts) (*Server, error) { +func NewServer(flGraphPath string, autoRestart, enableCors bool, dns ListOpts) (*Server, error) { if runtime.GOARCH != "amd64" { log.Fatalf("The docker runtime currently only supports amd64 (not %s). This will change in the future. Aborting.", runtime.GOARCH) } - runtime, err := NewRuntime(autoRestart, dns) + runtime, err := NewRuntime(flGraphPath, autoRestart, dns) if err != nil { return nil, err }