2 minute read

This post is a summary of notes I took when migrating from Docker Desktop to Podman. In case you missed it, Docker will now be charging for Docker Desktop, there are additional details in their blog. One major point is that the Docker engine and CLI are both free, for now.

There have already been many write ups on this topic. One by Marcus Noble is excellent. There are a few other unofficial and official write ups too.

Installing podman

So I’m on a Mac and tried the obvious thing to start:

brew install podman

That successfully installs the CLI but when trying to build an image you get an error.

I did some Googling and landed on the experimental instructions for Mac. It turns out that Docker was doing a bit more heavy lifting under the covers. To successfully build images with Podman you need a linux box running inside of a VM on the host. You can do this by running the podman machine commands below.

podman machine init
podman machine start

It’s worth noting that if you run into an error here, you need to install qemu to perform the necessary virtualization on your host.

brew install qemu

At this point you can quickly test out if images can built using Alpine Linux as a test:

podman images
git clone http://github.com/baude/alpine_nginx && cd alpine_nginx
podman build -t alpine_nginx .
podman run -dt -p 9999:80 alpine_nginx
curl http://localhost:9999

Common issues

Automatic published port forwarding

So the container is up and running but you can’t hit it, like this:

$ alpine_nginx git:(master) curl http://localhost:9999
curl: (7) Failed to connect to localhost port 9999: Connection refused

Turns out there’s a bug for this issue. First we need to access the Linux VM started by podman machine. Run the command podman machine ssh to enter an SSH session within the virtual machine created for Podman.

podman machine ssh

Edit the file ~/.config/containers/containers.conf

vi ~/.config/containers/containers.conf

Add rootless_networking = "cni" under the [containers] section.

Short-name resolution

The next error had to do with short-name resolution, like this:

$ podman build -t node-hello-world:latest .
STEP 1/7: FROM node:12-slim
Error: error creating build container: short-name resolution enforced but cannot prompt without a TTY

Again, ssh into the virtual machine

podman machine ssh

Edit the file /etc/containers/registries.conf

vi /etc/containers/registries.conf

And change short-name-mode="enforcing" to short-name-mode="permissive"

Alias docker to podman

Muscle memory is a thing. Edit your .bashrc to alias docker to podman.

alias docker=podman

Uninstall Docker Desktop

This took too much poking around. To uninstall Docker Desktop, first launch it, go to Settings > Bug icon > Uninstall.

uninstall docker