I'm a beginner with all this and I need to execute a docker command without using sudo
in ubuntu to use the gcc
compiler.
In order to make that happen, a friend of mine wrote a script, in go lang, named http-to-shell and that is a program that listens as http server on http://localhost:4000
, and executes commands on terminal and returns output to client as a json response.
I run the command
sudo go run http-to-shell.go
and then on another tab i use commands like
curl -d command=ls http://localhost:4000
this works perfectly and then if I use
curl --data-urlencode "command@command.txt" http://localhost:4000
it runs the docker command that is in command.txt
and shows the output of the program on the previous tab where i run sudo
go run.
Now, my main issue. Since I'm a beginner I have no idea how to run this from a jsp page from localhost:8080 in ubuntu.
I have been trying, I tried using the answer in Using curl command in java but the process builder doesn't work. I need to run this curl command and get json response to show the user the output of his code.
Please help me out here.