Skip to Content

Docker to Podman

I’ve been using Docker for a few years now to run my local development setup.

  • Docker - for my containers
  • Commandbox - so I can run whatever CFML engine I need (thanks Ortus!)
  • A database - currently MSSQL
  • Mailhog - a SMTP server to intercept email from my application

This all works great but when Docker recently decided to start charging for things I began looking for alternatives and found Podman.
(I don’t have an issue with Docker charging for their tools - I was just curious what else was available)

What is Podman? Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. Containers can either be run as root or in rootless mode. Simply put: alias docker=podman.

The important part there is docker = podman. Podman is a drop in replacement for Docker!

One thing to note: I am running Linux. If you are using Windows or Mac, Podman will run a virtual machine in the background (QEMU on Mac, WSL2 on Windows). I’ve used Docker on both Mac and Windows and found it very slow but have not used either in awhile so things may have improved with WSL2 and possibly Podman may improve things as well.

I wasn’t sure how difficult it would be to switch but it was relatively painless:

  • I uninstalled my current docker-ce and docker-compose. They say you can run both but I didn’t want any weird conflicts, especially as I had planned to alias ‘docker’ to ‘podman’.
  • Install podman (via apt)
  • Install podman-compose (via pip)
  • Update .bash_profile with docker alias: alias docker=podman

I tried spinning up my usual docker-compose file and immediately hit a snag. It was complaining it couldn’t find my images. It appears Podman can look in multiple locations for images, and unfortunately Docker hub isn’t included by default. The solution was simple - add an additional path docker.io/ to your image declaration:

image: docker.io/ortussolutions/commandbox:jdk8

My Commandbox setup is configured to serve my app on port 80. The next issue I ran into was since Podman doesn’t run as root I couldn’t hit port 80.

This is a security concern but it’s my local system so I just ran this to allow unprivileged users to access port 80:

sudo sysctl net.ipv4.ip_unprivileged_port_start=80

You can also choose to run Podman as root and avoid some of these issues, while exposing yourself to the risks of running containers as root :)

Finally I ran ‘podman-compose up’ and watched the console for any errors.

And it worked!

The only other issue I ran into was a permission issue with my MSSQL volumes. I create two volumes - one where I can store the MSSQL DATA folder so my dbs will persist, and the other is a backup folder where I can put .bak files and restore them. When I attempted to restore a database I got a permission issue when accessing my backup folder. This is again related to running Podman a non-root. If you run into this situation just Google for it and there are a variety of solutions based on how you have things configured.

Finally, once I confirmed everything was working I toasted my old Docker image and volume files just to free up some space.

I’ve been using Podman for a few days now with no issues. All my ‘docker’ commands I’m familiar with continue to work so there is no need to learn new commands.

Podman is just one of a set of tools available from the containers group - there is also:

  • buildah - for building images
  • skopeo is a command line utility that performs various operations on container images and image repositories
  • podman-desktop - a gui interface which mimics Docker Desktop

As I use Podman more I’ll try and blog about these additional tools.