diff --git a/docker/docker.go b/docker/docker.go index 71566539d8..b86f110bd6 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -21,7 +21,9 @@ func main() { flDaemon := flag.Bool("d", false, "Daemon mode") flDebug := flag.Bool("D", false, "Debug mode") flag.Parse() - rcli.DEBUG_FLAG = *flDebug + if *flDebug { + os.Setenv("DEBUG", "1") + } if *flDaemon { if flag.NArg() != 0 { flag.Usage() diff --git a/utils.go b/utils.go index 381af1fe38..dcd224adc5 100644 --- a/utils.go +++ b/utils.go @@ -45,7 +45,7 @@ func Download(url string, stderr io.Writer) (*http.Response, error) { // Debug function, if the debug flag is set, then display. Do nothing otherwise // If Docker is in damon mode, also send the debug info on the socket func Debugf(format string, a ...interface{}) { - if rcli.DEBUG_FLAG { + if os.Getenv("DEBUG") != "" { // Retrieve the stack infos _, file, line, ok := runtime.Caller(1)