Podman
Replacing Docker Desktop with Podman
For software development, I used Docker Desktop quite a lot. During development, I have a lot of dependencies that I don’t want to install permanently on my machine. Database servers are a prime example, I might have to work with either an Oracle, Microsoft SQL Server or PostgreSQL database for any given project. Running that dependency in Docker is really helpful.
I prefer open source tools and I heard good things about Podman so I decided to give it a shot. I’m writing down how I installed and configured it so this article might be of use for someone else.
Installing Podman Desktop
You can download a binary installer on the Podman website. I prefer using Winget. You can use the following command to install.
winget install -e --id RedHat.Podman-DesktopConfiguring Podman Desktop
After installation, Podman still needs to be set up. When starting Podman Desktop simply follow the instructions. It will first want to install Podman itself. Typically, you want to run Podman using Windows Linux Subsystem (WSL v2). This is the default selection.
When Podman is installed, Podman Desktop will want to setup a Podman machine for you. Again, simply use the default selection offered. After this part, Podman Desktop and Podman is installed and ready for use.
I recommend going to the Settings and Preferences and enabling Docker compatibility. This sets a Docker-compatible environment allowing all your tools that access Docker to use Podman.
Using existing Docker compose files
For my development, I already have a set of Docker Compose files that I use to setup different dependencies. See the example below that I use to setup Microsoft SQL Server 2022 with a separate datavolume so my databases are not lost when shutting down Docker.
name: SQL_server_2022
services:
sqlserver:
container_name: sqlserver_container
image: mcr.microsoft.com/mssql/server:2022-latest
environment:
ACCEPT_EULA: Y
SA_PASSWORD: addyourownpasswordhere
MSSQL_AGENT_ENABLED: true
volumes:
- sql2022datavolume:/var/opt/mssql
ports:
- "1433:1433"
volumes:
sql2022datavolume:Podman is API compatible with Docker, so you can use podman compose up to start
running that Docker Compose file.
However, if you prefer to keep on using Docker commands (maybe you have existing scripting you don’t feel like changing), you can create an alias. Since I use Powershell in my terminal, I simply added the line below to my startup profile.
Set-Alias -Name docker -Value podman $Profile to display its location.Now you can use docker compose up which will be rerouted to Podman.
The result
Now you can uninstall Docker Desktop and start on using Podman to run your containers.
Podman claims to be fully compatible with Docker Compose files but the hivemind of the internet has different opinions. Basic compose functionality seems to work fine but advanced scenarios with complex requirements might run into issues.
Having said that, for now I did not (yet) encounter this. Will update this post when necessary.