--- a/docker/run.go Sat Feb 17 00:14:44 2018 -0600
+++ b/docker/run.go Sat Feb 17 01:04:05 2018 -0600
@@ -283,23 +283,30 @@
cmd.Append("-w", workdir)
- // Check if the image does _not_ have a workdir set. If it doesn't,
- // set workdir to the convey workspace
- "{{.Config.WorkingDir}}",
- stdout, stderr, err := DockerOutput("checkWorkDir", cmdv, st)
+ id, err := ImageID(image, logger, st) - logger.Errorf("%s", stderr)
- if strings.TrimSpace(stdout) == "" {
- cmd.Append("-w", workspaceMount)
+ // Check if the image does _not_ have a workdir set. If it doesn't, + // set workdir to the convey workspace + "{{.Config.WorkingDir}}", + stdout, stderr, err := DockerOutput("checkWorkDir", cmdv, st) + logger.Errorf("%s", stderr) + if strings.TrimSpace(stdout) == "" { + cmd.Append("-w", workspaceMount) --- a/docker/util.go Sat Feb 17 00:14:44 2018 -0600
+++ b/docker/util.go Sat Feb 17 01:04:05 2018 -0600
@@ -64,3 +64,17 @@
+// ImageID will return the ID of the given image if it's available locally +func ImageID(tag string, logger *gomol.LogAdapter, st *state.State) (string, error) { + cmdv := []string{"image", "ls", "-q", tag} + stdout, stderr, err := DockerOutput("get image id", cmdv, st) + logger.Errorf("error: %s", stderr) + return strings.TrimSpace(stdout), nil