There are speed benefits for containers all over the place - both in time spent dealing with the environment and in actual execution.
There are speed benefits for containers all over the place - both in time spent dealing with the environment and in actual execution.
I just cold-booted a Vagrant VM, which is configured to check for new base-box versions (i.e. a network delay that can be disabled).
time vagrant up
...
real 0m39.698s
user 0m11.989s
sys 0m5.490s
If your argument about tooling is around performance and the "slow" one takes just 40 seconds to start, I think you need to clarify how often you expect to be starting this tool in a day.> Cached layers help.
Helps what, exactly?
> Not dealing with vm-specific kernel modules helps.
I don't even know what you're talking about here. Do you mean you need to have a hypervisor kernel module? What exactly do you need to "deal with"?
> Fast non-nfs volumes shared with the host help.
I've never once used an NFS volume in a Vagrant guest. In case you weren't aware, Vagrant is not limited to using VirtualBox.
> There are speed benefits for containers all over the place - both in time spent dealing with the environment and in actual execution.
You haven't actually identify any environment issues you need to "deal with", just said "X helps".
But there are other costs. Someone deals with updates, with adding new functionality, with debugging issues. I spend most of my day recently waiting for puppet runs in vagrant/vbox. It's 10+ min for a full run. Then I make more changes - sometimes an incremental provision is enough, sometimes I need a full rebuild. On the other hand, if the environment was built with docker layers, I'd have much less waiting to do, because the caching of partial build/layer is integrated. Over a whole day, that's not insignificant time saving.
And sure, vagrant has multiple backend. I'm using vbox, and so does almost every developer using vagrant. It's the only free one. (Apart from the docker backend)
Build your own base box with whatever prerequisites you have baked in. It's still a 10 minute puppet run if that's how long your provisioning takes, but that happens once, and then you distribute the box. While you can just use a base distro box, for large/complex setups it's not always the best approach.
What is the command/process to do that?
Personally I'd just put the call to `apt-get` and then `psql` into a shell script.
Either way, set the provisioner. Either do it in vagrant provisioning, or if that takes to long, build a base box with Packer and put the provisioner there.
Edit: or for a simpler use, look on Vagrantcloud.com and find a base box that has what you want, and run that.
version: "2"
services:
database:
image: postgres
environment:
- POSTGRES_PASSWORD=123456
ports:
- "5432:5432"
docker-compose up -d 0.59s user 0.14s system 50% cpu 1.462 totalAnd restarting it takes < 1 second.
You're relying on an existing image. That concept works in Vagrant too.
And if you want quick startup and are already on a Linux host, use vagrant-lxc.
You dont need to mess with a config management tool when you have docker.
That's what you're relying on with a '1 line command' in docker to give you Postgres: an image that someone else has created.
Whether a Postgres-only box exists in Vagrantcloud is irrelevant, unless your argument is purely on the merits of the pre-made boxes/images third parties have contributed.
If your entire decision making process is "I only run things that take two seconds" then I don't think we can have a conversation because honestly I don't even think about the time vagrant takes to start.
My computer does multiple things all at once. It takes longer for my IDE to start and be usable than it does for Vagrant, and funnily enough computers can run multiple processes at once, so this whole "omg 30 seconds is too long to wait" argument doesn't fly for me.
Once you have a running Linux Kernel. I don't use a Linux host OS, so I would still have a delay starting a VM to run Linux, and running a Hypervisor to run containers for a dev environment is too many levels of abstraction for my liking.
> you might not appreciate the quick boot up time but lot of others care about that. If you are happy with slow boot up
Is Docker quicker? Sure. Does that make Vagrant slow? No. Slower does not mean slow.
> but if you want something quick and easy then consider docker.
I prefer things I actually have control over rather than just "quick and easy".
I rest my case, feel free to yell at kids to get off your lawn.
> Slower does not mean slow.
Whatever makes you happy. If you are happy with vagrant stick to it, nobody is forcing you to use something better.
Most of the Packer builders (e.g. virtualbox, parallels, VMware) support building from scratch (i.e. start with ISO install media and a blank VM disk) OR building from an existing VM.
So you could have a multi-stage Packer build pipeline that iterates step by step.
But I'm still not really sure what your workflow is. My company builds a series of Debian (and for a client, Ubuntu) base boxes. When debugging issues, 99% of time required is checking/fixing inside a running box. Once a solution is found, applying that back to the base box provisioning scripts (or preseed or even the packer config) and testing a build doesn't take that long.