Hi,
I'm new to Docker and the whole container thing. I'm not sure I got all the basics right, so let me ask a couple of questions.
I was hoping to use Docker to build an evaluator-as-a-service behind a web server: users send source code to the server and get the result of execution back. If I understand correctly, Docker will allow me to execute code for each user in a sandboxed environment (a container), so that the code won't be able to damage the file system or access the network etc.
A couple of words about my current setup. I'm running OS X Mt Lion. I've followed these instructions[1] to install VBox and vagrant and setup an Ubuntu image. Inside the VM, I have the following:
vagrant@precise64:~$ docker version
Client version: 0.6.6
Go version (client): go1.2rc3
Git commit (client): 6d42040
Server version: 0.6.6
Git commit (server): 6d42040
Go version (server): go1.2rc3
Last stable version: 0.6.6
Now, the tutorial then finishes with an invocation of `sudo docker`. This is the part I'm not entirely sure about: am I supposed to invoke docker inside the VM?
I assume if I had a Linux box, I would not need to install VBox in the first place and would still be able to use docker to run processes in containers. Is this correct?
This leads me to the next confusion, about `docker run`. If I understand correctly, it always runs a process inside a VM. So do I need a VM on my server or not to be able to run a process in isolated environment via Docker?
As a matter of fact, I wasn't able to invoke `docker run` on my OS X machine to run a process inside VBox, it fails with an `unexpected EOF` error. Conceptually, what does `docker run` do? Is it a shortcut for `vagrant ssh -c sudo docker ...`?
And finally, a question about sudo. This description[2] hasn't cleared this up for me. So, the daemon process is running as root. And to be able to send it a command, I need to invoke docker with sudo. Does it affect in any way the process running in the container? In other words, is it safe to call "sudo docker execute_source ..." from the server code and not expect remote users to be able to take control of the server?
Sorry if any of the above questions are answered in the docs already, I must have missed them. I'll appreciate any pointers.
Thanks a lot!
--
Best regards
Alexei Sholik