compilebox icon indicating copy to clipboard operation
compilebox copied to clipboard

Integrating with docker-compose

Open denisorehovsky opened this issue 7 years ago • 0 comments

Has anybody tried to integrate compilebox with docker-compose? I have tried and haven't succeeded.

From the beginning, I was trying to create docker-in-docker. I had a container with node js app, inside which I had tried to create another container where the code would be executed (virtual_machine). But I didn't know how to do that correctly.

Then I found another way: expose the Docker socket to the container with node js app using this command (described here https://stackoverflow.com/questions/27879713/is-it-ok-to-run-docker-from-inside-docker):

docker run -v /var/run/docker.sock:/var/run/docker.sock ...

Thereby I have access to all my images inside the container with nodejs app.

But when nodejs app creates virtual_machine container, there is always a timeout error:

Listening at 8080
Python file was saved!
Input file was saved!
/api/DockerTimeout.sh 20s -u mysql -e 'NODE_PATH=/usr/local/lib/node_modules' -i -t -v  "/api/temp/024d82bd43cdd787649e":/usercode virtual_machine /usercode/script.sh python file.py  
------------------------------
ATTEMPTING TO REMOVE: temp/024d82bd43cdd787649e
------------------------------
Timed Out: temp/024d82bd43cdd787649e Python
Time: 
undefined

I think this error raises because nodejs app creates "sibling" container instead of "child" container. I'm not sure. Has anybody struggled with this problem?

denisorehovsky avatar Dec 12 '17 16:12 denisorehovsky