Skip to content

Commit bbea297

Browse files
committed
Merge branch 'master' into CustomDescribableModel-JENKINS-44892
2 parents 6b2df22 + f0c60a5 commit bbea297

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ private static class Decorator extends LauncherDecorator implements Serializable
257257
prefix.add(path);
258258
masksPrefixList.add(false);
259259
} else {
260-
launcher.getListener().getLogger().println("Docker version is older than 17.12, working directory will be " + ws + " not " + path);
260+
String safePath = path.replace("'", "'\"'\"'");
261+
starter.cmds().addAll(0, Arrays.asList("sh", "-c", "cd '" + safePath + "'; exec \"$@\"", "--"));
261262
}
262263
}
263264
}

0 commit comments

Comments
 (0)