moby: Improve debug output for 'docker run'
@@ -22,7 +22,7 @@ import (
)
func dockerRun(input io.Reader, output io.Writer, trust bool, img string, args ...string) error {
- log.Debugf("docker run (input): %s", strings.Join(args, " "))
+ log.Debugf("docker run %s (trust=%t) (input): %s", img, trust, strings.Join(args, " "))
docker, err := exec.LookPath("docker")
if err != nil {
return errors.New("Docker does not seem to be installed")
@@ -38,7 +38,7 @@ func dockerRun(input io.Reader, output io.Writer, trust bool, img string, args .
pull.Env = env
if err := pull.Run(); err != nil {
if exitError, ok := err.(*exec.ExitError); ok {
- return fmt.Errorf("docker pull failed: %v output:\n%s", err, exitError.Stderr)
+ return fmt.Errorf("docker pull %s failed: %v output:\n%s", img, err, exitError.Stderr)
}
return err
}
@@ -51,12 +51,12 @@ func dockerRun(input io.Reader, output io.Writer, trust bool, img string, args .
if err := cmd.Run(); err != nil {
if exitError, ok := err.(*exec.ExitError); ok {
- return fmt.Errorf("docker run failed: %v output:\n%s", err, exitError.Stderr)
+ return fmt.Errorf("docker run %s failed: %v output:\n%s", img, err, exitError.Stderr)
}
return err
}
- log.Debugf("docker run (input): %s...Done", strings.Join(args, " "))
+ log.Debugf("docker run %s (input): %s...Done", img, strings.Join(args, " "))
return nil
}
