ShellCommands commands = new ShellCommands();
String dockerImageName = imageSection.getImageName(buildId);
commands.add(imageSection.getDockerCommand(buildId));
/* @formatter:off */
DockerCommandBuilder runCommand = dockerCommand("run")
.flag("rm")
.flag("sig-proxy=true")
.flag("v", "`pwd`:/var/project")
.flag("w", "/var/project")
.flag("u", "`id -u`")
.args(dockerImageName, "/bin/bash -e dotci_build_script.sh");
exportEnvVars(runCommand, envVars);
/* @formatter:on */
if (servicesSection.isSpecified()) {
commands.addAll(servicesSection.getServiceStartCommands(buildId));
for (String link : servicesSection.getContainerLinkCommands(buildId)) {
runCommand.flag("link", link);
}
}
commands.add(runCommand.get());
return commands;
}