Podman: Getting Started

Your getting started guide to kickstart the Podman journey

Ajay Kumar S
Javarevisited
4 min readSep 25, 2020

--

This post is based on the video I made in TechPrimers. If you like the video format, the link for the video is here

What is Podman? How is it different from Docker?

Podman is a Daemonless Container Engine which can run OCI compatible images. It can run only on Linux machines (for now). If you have either Windows or OSX, you will have to use a Virtual Linux VM in VM Box or Hyperkit.

The major differences between Docker and podman (Pod Manager Tool) are —

  • Daemoneless — This feature differentiates itself from Docker, which runs a docker daemon to execute tasks. Podman is light-weight and doesn’t require an always running instance for running containers.
  • Rootless — Podman can be run as either root or non-root. We can run podman containers as non-root user and still be compliant with running containers.
  • Pods — The term Pods originated from Kubernetes. Pods are a collections of containers which are run as close as possible. Podman provides this feature out of the box for running multiple containers together.

Install Podman in Linux

Based on your runtime, you can choose the steps for Podman installation from the official documentation here. I will be using an Amazon EC2 with Linux, hence i will be using the following commands:

To verify if podman is installed successfully, we can check the version of the podman cli. In this case, I’m using 1.9.3 version of podman cli.

If you are familiar with docker, all the commands work on the same format with podman. There is a getting-started page in the podman site as well.

Some of the most commonly used commands are listed below

How to run Docker images with Podman?

In order to run containers, I will be using an existing Docker image which I built using Docker sometime ago. The image is present in Github Package Registry (docker.pkg.github.com) here.

To pull the image from Github Package Registry, we need to connect the podman cli with the registry

Once the login is successful, I’m going to pull the image which we require using the podman pull command

podman images shows the downloaded images in the local cache

This image contains a Spring Boot package with actuators enabled in it. We can run this image as a daemon container using the below podman command

This command starts a new container and maps the port 8080 from local VM to the 8080 from the container since the spring boot app is running on 8080.

To check the logs, podman logs <CONTAINER_ID> the command will help us

Now that the application is UP and running, let’s to access the container’s actuator endpoint, we can use curl to verify the status of the application

I have not covered the build part using Podman. Do try building images from a Dockerfile. They should be seamless to run with Docker since podman also follows OCI compatible image format.

Summary

In short, Podman wraps up the features of Docker for providing a light-weight container runtime which can be run as Daemonless and Rootless mode.

Let’s Podman!

--

--

Ajay Kumar S
Javarevisited

Building ☁️ | Opinions/Views expressed here are my own 🗣️