<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Docker-Compose on Guillaume Delré</title><link>https://guillaumedelre.github.io/tags/docker-compose/</link><description>Recent content in Docker-Compose on Guillaume Delré</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 18 Apr 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://guillaumedelre.github.io/tags/docker-compose/index.xml" rel="self" type="application/rss+xml"/><item><title>From Vagrant to Docker Compose: a retrospective</title><link>https://guillaumedelre.github.io/2022/04/18/from-vagrant-to-docker-compose-a-retrospective/</link><pubDate>Mon, 18 Apr 2022 00:00:00 +0000</pubDate><guid>https://guillaumedelre.github.io/2022/04/18/from-vagrant-to-docker-compose-a-retrospective/</guid><description>Why we replaced Vagrant with Docker Compose: the real friction points, the migration path, and what we&amp;#39;d do differently.</description><content:encoded><![CDATA[<p>I ran Vagrant for years. A Vagrantfile per project, a shared base box, a provision script that worked on Tuesday but not on Thursday. The promise was simple: reproducible environments for everyone on the team. The reality was more complicated.</p>
<h2 id="the-vagrant-years">The Vagrant years</h2>
<p>The setup made sense at the time. One VM per project, provisioned with shell scripts or Ansible, shared via a versioned Vagrantfile. Onboarding was theoretically <code>vagrant up</code> and you&rsquo;re done.</p>
<p>In practice, it was <code>vagrant up</code>, wait four minutes, watch the provision fail on a package that changed its download URL, fix it, reprovision, wait again. Vagrantfiles accumulated configuration over time: workarounds for specific machines, OS version pinning, memory tweaks for the team member whose laptop had 8GB. The files became historical documents nobody wanted to touch.</p>
<p>The VM itself was the other problem. Booting took time. Running took memory and CPU that could have gone to the application. File syncing between host and guest added latency that made PHP apps feel slower than they had any right to be. The overhead was significant for what was ultimately just &ldquo;run a web server.&rdquo;</p>
<p>We lived with it because everyone did. Vagrant was the standard for local PHP development, and the alternative (each developer managing their own LAMP stack) was clearly worse.</p>
<h2 id="the-project-that-changed-the-model">The project that changed the model</h2>
<p>The shift wasn&rsquo;t a decision we made. It was a project that arrived already containerized.</p>
<p>A new client project had a <code>docker-compose.yml</code> at the root, a <code>Dockerfile</code>, and a README that said <code>docker compose up</code>. We ran it. The containers started in seconds. PHP-FPM, nginx, PostgreSQL, Redis: all running, all networked, no provisioning step. Stop the containers, start them again, same state.</p>
<p>The contrast with our Vagrant setup was immediate. Not faster by a percentage: faster by a different order. And the Compose file was actually readable: each service, its image, its volumes, its environment variables, its dependencies. Compared to a provision script that SSHed into a VM and ran apt-get, this was legible.</p>
<p>We migrated everything. Not gradually, all at once, over a sprint. Every project got a <code>docker-compose.yml</code>. Every Vagrantfile was deleted. The transition was the most painful three weeks of infrastructure work I remember, and also the most clearly worth it.</p>
<h2 id="what-docker-compose-actually-changed">What docker-compose actually changed</h2>
<p>Beyond the speed, Compose changed the mental model. Vagrant abstracted a machine. Compose abstracted a set of processes. The distinction matters: with Compose, you can stop the database without stopping the application server, scale a worker service independently, swap the PostgreSQL image for a newer version without touching anything else.</p>
<p>The <code>services</code> declaration also replaced the VM provisioning problem entirely. If a new developer joins, they don&rsquo;t run a provision script that may or may not work on their OS version. They run <code>docker compose up</code> and get the exact same images everyone else runs.</p>
<p>CI/CD got simpler too. The same <code>docker-compose.yml</code> that ran locally could run in the pipeline. The environment parity that Vagrant promised but rarely delivered was actually real with Compose.</p>
<h2 id="the-quiet-deprecation">The quiet deprecation</h2>
<p>For years, the command was <code>docker-compose</code>: a separate binary, installed independently from Docker itself, written in Python, versioned independently. We used it, it worked, nobody thought much about it.</p>
<p>At some point a colleague mentioned that Docker had integrated Compose directly into the <code>docker</code> CLI. The new command was <code>docker compose</code>, no hyphen, Go rewrite, bundled with Docker Desktop. The old <code>docker-compose</code> binary was deprecated.</p>
<p>We had been using v1 for two years after v2 shipped. Our CI scripts, our Makefiles, our documentation all said <code>docker-compose</code>. Nothing had broken because Docker maintained the old binary for a long time. But the ecosystem had moved on quietly, and we&rsquo;d missed it.</p>
<p>The migration was trivial: a hyphen removed from every script, a few aliases updated. The lesson was less trivial. Infrastructure tooling evolves without ceremony. The announcement happened, the blog posts were written, the deprecation notices were there. We just weren&rsquo;t paying attention.</p>
<h2 id="the-actual-retrospective">The actual retrospective</h2>
<p>Looking back across Vagrant → <code>docker-compose</code> → <code>docker compose</code>, the pattern is less about the tools and more about the defaults.</p>
<p>Vagrant defaulted to &ldquo;it works on my VM.&rdquo; The overhead of sharing that VM was permanent.</p>
<p>Compose defaulted to &ldquo;it works in these containers.&rdquo; The images are the artifacts; the host machine is irrelevant.</p>
<p>The hyphen between <code>docker</code> and <code>compose</code> was always cosmetic. What mattered was the shift from provisioned machines to declarative services. That shift happened the day we ran a project someone else containerized and realized we never wanted to go back.</p>
]]></content:encoded></item></channel></rss>