What am I missing out if I'm not using a VM/Container for my development setup?
What up peeps.
For the past few weeks, I've dabbled and played around with Docker and Homestead just to see what's in store. But still, I can't see how much I'm gaining for the effort when my current setup (locally installed PHP7.2+Postgres+Redis etc. on a Linux box which is pretty much identical to my production setup) already works. Can someone fill me in? Maybe I'm looking at it the wrong way.
You are missing out on all the hipster grooves man!
It all depends on the project. I work in an enterprise setup and nobody on the DevOps or Infrastructure side has seen the need for a docker approach yet. We are looking into the benefits and have been putting this off.
I'm sure somebody who uses Docker will be able to give a better detail benefit usage than me.
From my simple understanding, docker has the benefit that everything you need is already packaged up and you don't have to deal with Infrastructure giving you headaches about your requirements.
Still, if your setup works then Docker might just be a great learning experience rather than something you really need. Remember, the net has made it this far and we used to use FTP and folders on our local machines for version control.
@SAPPOROGUY - > You are missing out on all the hipster grooves man!
Ayyyy I do like my hipster points!
From my simple understanding, docker has the benefit that everything you need is already packaged up and you don't have to deal with Infrastructure giving you headaches about your requirements.
Yeah, that makes sense and I can see how that could be useful. But I'm still not sold how that is better than $ bash setup_and_install_everything_i_need.sh. Which I'm sure someone will come later and educate me how that's terrible and I'm definitely all ears.
Still, if your setup works then Docker might just be a great learning experience rather than something you really need. Remember, the net has made it this far and we used to use FTP and folders on our local machines for version control.
The only part that would be different is that, if you need to develop for a different server setup (old PHP / MySQL or whatever odd software / libraries) you don't have to screw with your workstation environment..... just setup a specific virtual box for that project.
I've had it too many times that I had to develop something for a company where the library requirements were so exotic it took me a while to re-setup my linux box for it (video encoding libraries, or domotics on strange usb / serial drivers).
After that, I never really got it back as i wanted to and ended up doing a complete reinstall of my workstation (not that bad as it was actually something I was pushing ahead constantly for months already)
Now i just have a few VM's all setup just like their servers and it's saved me a lot of headaches.
My understanding is that Docker is like a vm but on a smaller scale. You are only including the bare necessities compared to a full vm setup. Also, you can have multiple dockers (what ever they are called) to run microservices and such.
I have run into many situations that you described and I just leave my machine with all those extras in. But I do run vms when the distro is completely incompatible to what I am using.
I run OSX a lot and most people forget that it's not case sensitive like Linux is. This has bit me several times.
One of the advantages of using docker is that you can have a docker image file for each version of software you are using and swap them out for testing and upgrades. Imagine being able to test on Laravel 5.4 then on 5.8 just by changing one line in a YAML file. Or with PHP. Or mysql. Or redis.
On the other hand, it makes managing things a little more complicated than those that are used to setup_and_install_everything_i_need.sh
I am not sure that you "loose" anything, as it really depends on your environment. I will tell you why we use containers (docker), as maybe some of the points will be beneficial to you?
Here are some key reasons for us...
We use docker on GKE for our sites, so we run the EXACT same "server" on all environments as we do locally
We have multiple projects that are on different versions of Laravel, so we can switch projects without worrying about local configuration
We use a docker-compose file to setup individual containers for the services, so that we have to make sure that our code works when deployed as we have had issues in the past with sessions or file storage not working when deployed because a dev assumed that everything was local
Our CI/CD pipeline runs all test in 2 parallel containers with php7.2 & php7.3, but 7.3 is allowed to fail. We have been "watching" 7.3 comparability, so we are ready to go once we feel like 7.3 is ready to go live
In the end, it is more stuff to keep up with & points to troubleshoot, but for our team it is better.
I hope that some of those points will help you make your mind about what is best for you.