I have written shell scripts inside the springboot application which perform invoke and query functionality in blockchain network (hyperledger fabric). I am executing the script by the following way,
ProcessBuilder processBuilder1 = new ProcessBuilder();
processBuilder1.command(Util.HOME
+ "/work/src/xxx.sh",
dealId);
Process process1 = processBuilder1.start();
// process1.waitFor();
StringBuilder output1 = new StringBuilder();
BufferedReader reader1 = new BufferedReader(new InputStreamReader(process1.getInputStream()));
String line1;
while ((line1 = reader1.readLine()) != null) {
logger.info("output:::" + line1);
output1.append(line1 + "\n");
}
I run the application as a jar file in VM, everything including the shell script call part also is getting executed fine.
But when i pushed the jar file into docker and run the application as docker image, I am not able to process those shell script call which present inside the application.
Can anyone suggest me? Thanks in advance.