I need to create a more organized, structured, local development process and I'm wondering if either Vagrant or Docker are clearly better with Wordpress. It's possible neither are "better" in any significant way but I'm not sure.
I have a broad understanding of the differences between Vagrant and Docker. It could be that those differences are all that matter.
I jump back-and-forth between Vagrant (either Chassis or VVV) and Docker depending on which project I'm working on, and I'm generally happier when using Docker because it is much faster, demands much less memory and processing and is generally less error prone in my experience.
That said, whenever I need to a) change an environment, or test different env directives to see which fits best, or b) run CLI tools that are not part of my everyday routine, I find it generally simpler to do that in Vagrant because everything is in one place and all the build scripts and config files are promptly available.
With Docker you're often times using pre-built, general-purpose images that provide each piece of your environment - which is great for stability. But if an image is not a perfect fit, then you need to search for another one, or roll out your own - which might be fun, but can also be very time consuming.
In the case of CLI scripts, there's usually some setup needed and you'll need some aliases added to your .bash_profile to run smoothly, so that's also some overhead. If you use them often (think wp-cli) you'll only do this once for all containers, which is fine, but if you need different tools for different projects this can also pile up fast.
In short, have both at hand, they are very useful in different cases :)
I guess that it really depends on what you need to achieve and how complex your Wordpress setup is? If you plan to do some local development, then I'd +1 Docker (with Docker-compose) as well as it will make things go quicker.
You can have a look at the following stack:
As well as this video tutorial: youtube.com/watch
Dana Ross
Building the web since 1996. Full-stack developer, feral & abused cat socializer, tech history buff. Director of Engineering at 10up.
A lot of my co-workers are switching to Docker. It's more efficient, especially when containers run Alpine Linux for tiny memory footprints. 10up recently released wp-local-docker -- give it a try!
Docker is especially nice on Windows, believe it or not. HyperV is very efficient running it, and I've heard future versions will take advantage of the Windows kernel's new built-in Linux API support and Linux containers will run natively on top of Windows.