Ask HN: How Easy Would It Be to Replace Docker with VirtualBox?
The reason I use Docker is that I can quickly run sandboxed code and have it access a local folder:
docker run -v $PWD:/somedir --rm someimage somecode /somedir
I wonder if that is actually a new thing Docker introduced or if a similar command line exists for VirtualBox?
3 comments
[ 3.5 ms ] story [ 16.6 ms ] threadIn 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.
If running code via Docker takes 10ms and via VirtualBox it takes 40ms that would make no difference at all, even though it is 4x slower.
create an .ova file as a template for your sandbox.
to "spin up" your sandbox you have to import that image, add a shared folder and start it headless:
or something like that. You can find most of that stuff in Chapter 8 of the VirtualBox docs: https://www.virtualbox.org/manual/ch08.html