in src/main/java/com/google/devtools/build/remote/client/RemoteClient.java [333:361]
private void setupDocker(com.google.devtools.remoteexecution.v1test.Action action, Path root)
throws IOException {
com.google.devtools.remoteexecution.v1test.Command command;
try {
command =
com.google.devtools.remoteexecution.v1test.Command.parseFrom(
cache.downloadBlob(toV2(action.getCommandDigest())));
} catch (IOException e) {
throw new IOException("Failed to get Command for Action.", e);
}
Command.Builder builder =
Command.newBuilder()
.addAllArguments(command.getArgumentsList())
.addAllOutputFiles(action.getOutputFilesList())
.addAllOutputDirectories(action.getOutputDirectoriesList());
for (com.google.devtools.remoteexecution.v1test.Command.EnvironmentVariable var :
command.getEnvironmentVariablesList()) {
builder.addEnvironmentVariables(
Command.EnvironmentVariable.newBuilder()
.setName(var.getName())
.setValue(var.getValue())
.build());
}
if (action.hasPlatform()) {
builder.setPlatform(toV2(action.getPlatform()));
}
setupDocker(builder.build(), toV2(action.getInputRootDigest()), root);
}