Trellis: Vagrant vs. Docker - Will the Switch Ever Happen?


#1

Hello there,

After reading a number of posts on people making the switch from using the “heavier and slower” Vagrant to the nimbler Docker, I’m wondering if Trellis will ever make the switch to Docker?

Also, after looking at the general trends of the two: https://trends.google.com/trends/explore?q=vagrant,docker - It makes me feel like Docker would be the more future-proof bandwagon to jump on.

This honestly is just a lot of ignorance talking and I wanted to see what the community’s opinion was on this.

Any feedback would be appreciated!


#2

I’ll just leave this here ᕕ( ᐛ )ᕗ


#3

Docker containers are for the final version of a production ready piece of software.

Docker containers work best when your web app is built with scalability in mind, when you intend your app to end up in a https://kubernetes.io/ like environment.

In Docker, instead of running recipes to provision a server that, at the end of a sometimes very long process, also includes your WordPress code somewhow, you instead drop a git looking binary blob into your target and you are done. It’s faster! Faster for … production deployments

My experience with developing PHP on Docker is that it sucks. File mapping does not work the same way. The whole save then refresh the browser to see changes workflow doesn’t work very well in Docker.

The Docker development flow is better suited for developers that recompile and/or restart their web server every time they save their files (Think: Typescript, Node.js, Python WSGI, Java … )

Furthermore, Trellis is not deploying Vagrant into production? You can certainly jiggle your settings and end up with Docker there if you need that kind of scalability?

Things are improving for PHP on Docker though. If you want to play around with Docker check out: https://phpdocker.io/

I’m not against it, but there is certainly a lot of misunderstanding circulating for who or what Dockers was built for, where PHP Developers are last on the list.


#4

My WordPress dev workflow involves lots of wp-cli use – ie, to inspect the data, update options, create dummy content etc,

I’ve found using wp-cli with docker to be somewhat tricky to get working flawlessly. Granted, I haven’t spent too much time figuring it all out, but following this post got things working sort of.

I can certainly see the benefits of Docker + WP, but it’s also some new territory, so ‘here be dragons’. Exciting, but one more new shiny thing to learn before the looming work deadline :wink:

From my usage of Trellis, it just feels more targeted to the traditional server stack, which I like. So one possible solution I can see is to create a new project in the roots family – one geared more to using / deploying WP to containerized environments.


#5

@daniel I’m using bedrock+roots with capistrano (for deploys) with stacker (docker) https://github.com/Maxlab/stacker

Trellis is nice a thing but when you have to handle a lot of projects parallel the provision time gets annoying and on small macbooks for example the disk space is kinda important too which isn’t in favor of trellis.

Regards.


#6

I’ve built a neat development setup for Bedrock with docker over here: https://github.com/schliflo/bedrock-docker
Would love to get some feedback - so if you happen to have some time: try it and drop me a line if you like it or not. I’m happy to assist if you run into any problems.