The reason I use Docker is that I can quickly run sandboxed code and have it access a local folder:<p>docker run -v $PWD:/somedir --rm someimage somecode /somedir<p>I wonder if that is actually a new thing Docker introduced or if a similar command line exists for VirtualBox?
The advantage of running docker is that you don't virtualize things => everything is faster (boot time, access files and so on). (assuming you're runing on a Linux machine)<p>In Virtual Box you have this „Shared Folders” which basically acts the same (I have no idea if/how you can do this via CLI though). But the access to that is done via SMB, so even if everything is local, you'll have some latencies involved.
what you have to consider is, that docker does not emulate hardware and does not run a complete OS inside. that said you can definitly do something in that direction with virtualbox:<p>create an .ova file as a template for your sandbox.<p>to "spin up" your sandbox you have to import that image, add a shared folder and start it headless:<p><pre><code> vboxmanage import yourtemplate.ova --vsys 0 --vmname yourvmname
vboxmanage sharefolder add "yourvmname" - name "SF name" -hostpath "x:\path"
vboxmanage startvm yourvmname --type headless
</code></pre>
or something like that. You can find most of that stuff in Chapter 8 of the VirtualBox docs: <a href="https://www.virtualbox.org/manual/ch08.html" rel="nofollow">https://www.virtualbox.org/manual/ch08.html</a>