Using docker for development
A problem solved
A problem I saw in my first development job was onboarding new developers. We had an environment that required you to be running two Laravel apps, one Quasar app and an instance of Moodle. Getting these things to work in tandem wasn't exactly trivial to a new developer. At first we would spend a couple of days working with them to get everything set up. But as time went on, this became very tedious as I was constantly helping these juniors to "fix their environment". One day I had had enough. Myself and the other developers on the team worked together to create a set of docker images that the would be a replica of our production environment. After all, our prod environment was using docker, why not our dev environment as well?
This worked out better than I could have hoped.
Yes, there was some initial issues with setting up docker on the junior's machine and teaching the basics of bringing the containers up and down and how to exec into the container to run commands, but it was MUCH better than before. No more random MacOS bugs. No more random WSL issues (this was in the WSL1 era. Those who know, know.) We had something steady to work with.
Also at this time Visual Studio Code had created a plugin that allowed you to "remote into your container". This was a huge win for us. No more dependencies on a person's machine, everything you need is in the container. You can even install the plugins for VSCode into the containers and you were off to the races.
Docker for development today
Today, I use docker for development on all of my side projects. I use this environment that my friend and I worked on in our off hours to solve the above problem. I've added a few containers over the years and I'm sure I'll add more as I experiment with new technologies. This environment means I can experiment with python, even I don't want it on my machine. I can play with C# without adding .NET to my machine, etc etc. Each development environment for each language is clean and minimal. If I want to upgrade versions I change a line in a dockerfile, rebuild the container and I'm good to go. If I need multiple version of PHP? Two containers with different versions of PHP, problem solved.
This has really changed the game for me and it has helped me learn docker in a way that is helpful for me daily, instead of just being a skill to be used for deployment of my apps. If you haven't already learned docker, I highly recommend you do! I believe it is a game changer.
Published: Fri Jan 14 2022
