Automating Development Workflow with Docker and Ansible
2025-11-25
When I first built my small, personal server I had really only 2 goals: do school work and run dev servers (maybe sometimes a minecraft server). And for a long time the server did just that and it did it well. I was using Arch as my distro and I loved the customization potentials and the bareness of it all. But as my projects grew and grew so did the amount of packages on my system; at some point, it became hard to keep track of it all. On top of this, I was running into a constant issue with GRUB and some configuration that I must’ve changed that made it so every kernel update would destroy my GRUB and bootloader configuration.
Around 6 months in, I started to think about wiping my system and starting from new. I shopped around for linux distros that would give me more stability (mostly server Ubuntu LTS) compared to Arch but every one that I found had too much pre-installed software that I just didn’t need. Turns out the grass was not greener so I decided to stick with Arch but change the way I approached my workflow.
Since I was still new and learning operating systems and system technologies, I wanted a way to nuke my system and start from base principles. This gave me leeway to learn and wreck things along the way. I settled on Ansible at first because I heard that it was a fantastic tool to install packages and maintain a system status quo but Ansible only works on an already installed distro. I didn’t want to reinstall Arch every time so I turned to containers.
In terms of containers, Docker is the most popular and with the most
support and documentation so that is what I went with. Now my workflow
is to ssh into my system, docker compose up a project, and connect
to my code base using VS Code. If I ever mess up a container whether
that is changing a config file or installing some random package, I can
just docker compose down the container and start it up again.
Basically, the core goal was disposability. I wanted to be able to wipe my machine and be back up and running in minutes without manually reinstalling packages. So to do this, I separated my infrastructure into three distinct layers:
- The Foundation: A minimal Arch Linux host.
- The Manager: Ansible playbooks to maintain the host.
- The Workspace: Docker containers for actual development.