Skip to content

Commit

Permalink
lib: improve DockerUtils class, #TASK-6445
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Sep 19, 2024
1 parent c5cb58a commit 0008005
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public static String buildCommandLine(String image, List<AbstractMap.SimpleEntry
setUser = false;
}
for (String key : dockerParams.keySet()) {
commandLine.append("--").append(key).append(" ").append(dockerParams.get(key)).append(" ");
if (!key.startsWith("-")) {
commandLine.append("--");
}
commandLine.append(key).append(" ");
if (StringUtils.isNotEmpty(dockerParams.get(key))) {
commandLine.append(dockerParams.get(key)).append(" ");
}
}
}

Expand All @@ -62,7 +68,7 @@ public static String buildCommandLine(String image, List<AbstractMap.SimpleEntry
// Mount management (bindings)
for (AbstractMap.SimpleEntry<String, String> binding : inputBindings) {
commandLine.append("--mount type=bind,source=\"").append(binding.getKey()).append("\",target=\"").append(binding.getValue())
.append("\" ");
.append("\",readonly ");
}
}
commandLine.append("--mount type=bind,source=\"").append(outputBinding.getKey()).append("\",target=\"")
Expand Down

0 comments on commit 0008005

Please sign in to comment.