AWS Builder Center

Replacing Docker with Podman: A Hands-On Containerization Experiment

I already had a containerized Python ML application, so instead of building another demo, I replaced its Docker workflow with Podman. This experiment explores Podman’s daemonless and rootless architecture, container security principles, OCI compatibility, automated builds with GitHub Actions, publishing to GHCR, and deploying the container on AWS Lightsail

Replacing Docker with Podman: A Practical Experiment

I've been using Docker for containerizing applications, so instead of learning Podman through a simple tutorial, I wanted to test it against something I had already built.
For this experiment, I took my Python-based keyword extraction application and replaced the Docker workflow with Podman.
The project combines spaCy, TF-IDF, and Sentence Transformers to extract and rank keywords from text. The application itself remained unchanged throughout the experiment.

Why Podman?

Docker has become the default container tool for many developers, but it isn't the only way to manage containers.
Podman is an open-source, OCI-compatible container engine with a daemonless architecture and support for rootless containers. Its CLI is intentionally familiar to Docker users, making migration relatively straightforward.
The difference I was most interested in was the security model.
With a traditional Docker setup, the Docker daemon is a central component of the container workflow. Podman doesn't require a central daemon, and its rootless mode allows containers to run inside a user namespace without giving the container more privileges than the user launching it.

Docker → Podman

The practical migration was surprisingly small.
Instead of:
docker build
docker run
docker images
docker push

I could use:
podman build
podman run
podman images
podman push

The existing container definition and application did not need to be fundamentally redesigned.
This was the main result of my experiment: the containerized application remained the same while the container engine changed.

Security Perspective

Podman's rootless approach fits naturally with the principle of least privilege.
A rootless container cannot gain privileges beyond those available to the user running Podman. Podman also supports additional isolation and security controls such as capability dropping, read-only filesystems, and security profiles.
This doesn't make an application automatically secure. Container security still depends on image provenance, dependencies, capabilities, secrets management, filesystem permissions, and runtime configuration.
But reducing unnecessary privileges is a useful security boundary.

CI/CD Experiment

I also replaced the Docker commands in my GitHub Actions workflow with Podman commands.
The workflow automatically builds the container image and publishes it to GitHub Container Registry, so the experiment wasn't limited to my local machine.
The resulting flow became:
GitHub Repository
│
▼
GitHub Actions
│
▼
Podman
│
▼
OCI Container Image
│
▼
GHCR

I also deployed the containerized application once on AWS Lightsail, taking the experiment beyond local development and into an actual cloud environment.

What I Took Away

This experiment changed how I think about containerization.
Podman isn't simply "Docker with different commands." Its daemonless architecture, rootless execution, OCI compatibility, and pod support make it a useful tool to understand as the container ecosystem becomes increasingly cloud-native.
For me, the most useful part was actually doing the migration:
Existing ML application → Docker workflow → Podman → automated CI build → GHCR → AWS Lightsail
No new application was required. I simply replaced one piece of the infrastructure and observed how much of the existing workflow continued to work.
That is exactly why I wanted to experiment with Podman rather than just read about it.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article