--- a/ChangeLog Mon Feb 12 21:54:59 2018 -0600
+++ b/ChangeLog Mon Feb 12 22:17:07 2018 -0600
@@ -4,6 +4,9 @@
* Fixed an issue where the files for clean tasks were not having their
* Fixed a bug where tasks weren't being validated. Fixed #160
+ * Set the workdir parameter for docker/run tasks to ${CONVEY_WORKSPACE} if + the image does not have a workdir set and the user has not specified on in * Write warning, error, and fatal log messages to stderr. Fixed #156
--- a/docker/run.go Mon Feb 12 21:54:59 2018 -0600
+++ b/docker/run.go Mon Feb 12 22:17:07 2018 -0600
@@ -224,6 +224,14 @@
// create an id for this container
+ // Map the image name so we can use it elsewhere + image, err := environment.Mapper(r.Image, fullEnv) + } else if image == "" { cmd := command.NewGenerator(
@@ -274,6 +282,25 @@
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) + logger.Errorf("%s", stderr) + if strings.TrimSpace(stdout) == "" { + cmd.Append("-w", workspaceMount) @@ -366,11 +393,6 @@
// add the image to the command
- // TODO make sure image isn't an empty string
- image, err := environment.Mapper(r.Image, fullEnv)
// append the command if we have one