I'm trying to compile a C file named test.c using docker's gcc container.
I'm using the following command, I have put the test.c in my home
in ubuntu.
sudo docker run -v /home/moomal/workspace/FypProject/WebContent/file/:/myapp.c:ro gcc:4.9 sh -c "gcc -o myapp /home/moomal/workspace/FypProject/WebContent/file/myapp.c; ./myapp"
It works cool, but, I want to change the folder from home
to a folder inside my eclipse web project folder. I have an editor on a web page and then on compile it creates a test.c file inside a folder. I want to access that file.
I tried adding the path like /home/moomal/workspace/FypProject/WebContent/file
but I get the error
gcc: error: /home/moomal/workspace/FypProject/WebContent/file/myapp.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
sh: 1: ./myapp: not found