Local Docker Registry now in Kamal 2.8!

If you’re working in Ruby on Rails 8 and are not using Kamal, I highly suggest that you give it a look. I’ve personally been using it to deploy a number of applications and I find the entire process to be very streamlined!

I’ll give a simplified overview of what Kamal does assuming you have done the setup step on a server (it’s as simple as running kamal setup)

  1. It builds an image locally
  2. It pushes that image to a registry (by default it’s Docker Hub)
  3. You pull down the image from the registry
  4. You run the image on the server

Now, one problem I had was that prior to Kamal 2.8, whenever we build the image, we had to push it to a registry, now wouldn’t it be great if we didn’t have to rely on an external provider for the registry service? There are other ways to host your own registry but in practice one would usually use existing providers like Docker Hub / Github / ECR / Artifact Registry mainly to reduce setup complexity.

With Kamal 2.8 which included this PR, we now are able to build the image locally, push it to a registry locally and then have the remote servers pull directly from those local registry. This removes the dependency on an external provider!