Merge pull request #27460 from Microsoft/jjh/dockerpid
Windows: Calculate PID file after root
This commit is contained in:
commit
ce6cfef36d
|
@ -3,6 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/docker/cli"
|
"github.com/docker/docker/cli"
|
||||||
|
@ -61,6 +63,11 @@ func runDaemon(opts daemonOptions) error {
|
||||||
|
|
||||||
daemonCli := NewDaemonCli()
|
daemonCli := NewDaemonCli()
|
||||||
|
|
||||||
|
// On Windows, if there's no explicit pidfile set, set to under the daemon root
|
||||||
|
if runtime.GOOS == "windows" && opts.daemonConfig.Pidfile == "" {
|
||||||
|
opts.daemonConfig.Pidfile = filepath.Join(opts.daemonConfig.Root, "docker.pid")
|
||||||
|
}
|
||||||
|
|
||||||
// On Windows, this may be launching as a service or with an option to
|
// On Windows, this may be launching as a service or with an option to
|
||||||
// register the service.
|
// register the service.
|
||||||
stop, err := initService(daemonCli)
|
stop, err := initService(daemonCli)
|
||||||
|
|
|
@ -2,14 +2,15 @@ package daemon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
|
defaultPidFile string
|
||||||
defaultGraph = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
|
defaultGraph = filepath.Join(os.Getenv("programdata"), "docker")
|
||||||
)
|
)
|
||||||
|
|
||||||
// bridgeConfig stores all the bridge driver specific
|
// bridgeConfig stores all the bridge driver specific
|
||||||
|
|
Loading…
Reference in New Issue