0

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.

  • What does your shell script do? Your shell script should run properly inside docker but if it invokes a process that's not in the image, those won't run. Either add those to the image or mount the bins – kirupakaranh May 19 '20 at 12:59
  • shell script will perform invoke and query in hyperledger fabric. Yes I tested manually inside docker, shell scripts run properly. I my case, I have written, shell script call or execution process in the springboot application. Now I converted that springboot application jar file into images and run that image in docker. In this situation, now I am trying to call or execute my shell scripts, I didn't get any error, application also running. But shell scripts result, I got only null value. – Manju v May 20 '20 at 13:12

0 Answers0