Podman Pull Docker Image: Easier Than You Think!

Estimated reading time: 7 minutes

Last updated on November 8th, 2024 at 05:48 pm

Introduction: Podman Pull Docker Image

Docker provides a full-fledged ecosystem and toolset to manage and run the container application. But if you’re looking for lightweight and secure rootless management- Podman is the powerful alternative.

Podman Pull Docker Image
Podman Pull Docker Image

I already wrote about the difference between Docker and Podman, check for the in-depth comparison and which one is right for you.

Podman vs Docker: Choose the Right One

Podman Cheat Sheet

FREE Podman Cheat Sheet (Everything You Need, In One Place)

This is the last Podman Cheat Sheet you’ll ever need. Why?
Because it’s not just a list of commands—it’s a shortcut to make your work easier, faster, and more effective.

Stop wasting time digging through documentation. With this cheat sheet, you’ll get exactly what you need, right when you need it.

Understanding Podman and Docker

Podman provides the drop-in replacement by providing the alias for Docker, you have the same Docker CLI command but there’s one key difference.

Podman runs rootless by default. You don’t need the root privileges makes it secure. Both the Podman and Docker have the same CLI commands and image format, you can use the same Docker understanding and apply with the Podman.

This means you can use the Docker Hub container registry and pre-built Docker images directly with your machine.

Feature: Podman Pull Docker Image

  • Secure by Default: Podman runs the rootless container, and makes it secure!
  • Restricted Access: Users don’t need to have the root privileges for pulling Docker image
  • Existing Workflow: Utilize the same Docker image knowledge and integrate with Podman.

Let’s explore how Podman provides the identical Docker CLI for the Podman pull Docker image.

Prerequisites:

Before we start, check the below requirements:

1. Podman Installed:

This one is obvious and I assume you already have the Podman installed and running. If you need to install the Podman you can follow the official Podman documentation. If you want to utilize the new feature and platform-specific build check the below article:

Build Podman from Source: 5 Easy Steps

Podman Pull Docker Image
Podman Pull Docker Image
2. Docker Hub Account ( Optional ):

This step is optional but Docker Hub has some rate limits and sometimes restricts you from accessing the private repository. You can create a free Docker Hub account from the official Docker HUB.

Podman Pull Docker Image: Hands-on

Enough of theory, let’s check the practical for Podman pull Docker image with a hands-on approach.

Basic Pull Command:

Pulling container images is the straightforward way:

Bash
podman pull <image_name>

Let’s say you want to pull the container image alpine:

Bash
podmman pull alpine

Podman will use the “latest” tag for the image if you don’t mention

Specify an Image Tag:

You can pull the specific version of the image by specifying the <tag>:

Bash
podman pull <image_name>:<tag>

Let’s say you want to pull the “3.17” version of “Python”:

Bash
podman pull python:3.17

One thing you may have noticed here, commands are essentially the same docker pull and podman pull

Podman Pull Docker Image:

When pulling from the Docker Hub you can use the registry name along with the image:

Bash
podman pull <registry_url>/<image_name>:<tag>

Let’s say you want to pull the nginx image from the Docker Hub:

Bash
podman pull docker.io/library/nginx:latest
Podman Pull Docker Image with Shortname:

If you don’t want to define the docker.io prefix all the time when you pull the image from Docker Hub, you can use the Podman feature called “unqualified search registries”:

The default location for the configuration is: /etc/containers/registries.conf

Let’s modify the file to support the short name

Bash
nano /etc/containers/registries.conf

# Add the below line to enable Podman pull Docker Image
unqualified-search-registries = ["docker.io"]

Now you can use the Podman pull command for the Docker image directly:

Bash
podman pull nginx:latest

Shortname Alias in Podman Registry

Podman can pull images from all kinds of registries private or public. But the important thing to understand here is the Shortname Alias when “Podman Pull Docker image” or from other registries.

When you pull the container image nginx, instead of writing the whole image location docker.io/library/nginx:latest, you can use the nginx:latest.

This is called the surname alias, this is a super helpful feature to use the short name instead of the full URL but that can cause the issue as Podman doesn’t;t know the exact registry to pull from.

Unqualified Search Registries

Podman maintains the list of “unqualified search registries” for finding the container image when using the short name alias.

There’s a security issue if the attack modifies the short-name-aliases.conf file that Podman uses, it can make the user download a malicious image.

Bash
# Root 
/var/cache/containers/short-name-aliases.conf

# Rotless
$HOME/.cache/containers/short-name-aliases.conf
Best Practices for the Shotname Alias

Shortname alias provides the shortcut for the container image. I strongly advised using the fully-qualified image name for clarity and security to eliminate the possibility of malicious code pull.

Podman Cheat Sheet

FREE Podman Cheat Sheet (Everything You Need, In One Place)

This is the last Podman Cheat Sheet you’ll ever need. Why?
Because it’s not just a list of commands—it’s a shortcut to make your work easier, faster, and more effective.

Stop wasting time digging through documentation. With this cheat sheet, you’ll get exactly what you need, right when you need it.

Advanced Podman Pull Docker Image Options

Podman offers a variety of ways to pull the container images, using this advanced option is helpful for complex workflow setups.

Pull Image by Digest:

Using the latest tag is not advisable for the production image as tags can change over time.

Consistency is important in a production environment for that you can use this command to guarantee specific image versions:

Bash
podman pull <image_name>@<digest>

Let’s say you want to pull the specific image digest for the alpine:

Bash
podman pull alpine@sha256:d7342993700f8cd7aba8496c2d0e57be0666e80b4c441925fc6f9361fa81d10e

Pull Multiple Images at Once:

You can pull multiple images at once to save time with a single command:

Bash
podman pull <image1> <image2> <image3>

Let’s say you want to download busybox, alpine and nginx:

Bash
podman pull busybox:latest alpine docker.io/library/nginx

Troubleshooting Podman Pull Issues:

Podman pull container image is straightforward but occasionally you might encounter errors. The most common command errors and solutions are the below:

1. Network Connectivity

This is a common error when you have unstable internet connectivity. Ensure you have a stable internet connection and additionally verify with pining the server 8.8.8.8

Bash
ping 8.8.8.8
2. Registry Issue

Ensure the remote registry you’re trying to use is accessible and not facing downtime. If the registry has the health or service status page check for the additional information.

3. Authentication Error

This is a most common issue when pulling the container image from the private registry, double-check your authentication credentials.

5. Image Not Found

Check for the misspelled image name or the tag while Podman pull the Docker image. If you pull an image that doesn’t exist on the registry you face this issue.

Conclusion:

Podman Pull Docker Image is a simple method to pull the container image from the Docker Hub.

  • Use the full-qualified image name and avoid the short name.
  • Use the registries.conf for the “unqualified-search-registries”

Additional Reading

Podman Build from Dockerfile: Made Easy

How to Use Docker Compose with Podman

Podman Cheat Sheet

FREE Podman Cheat Sheet (Everything You Need, In One Place)

This is the last Podman Cheat Sheet you’ll ever need. Why?
Because it’s not just a list of commands—it’s a shortcut to make your work easier, faster, and more effective.

Stop wasting time digging through documentation. With this cheat sheet, you’ll get exactly what you need, right when you need it.

Kashyap Merai

Kashyap Merai

Kashyap Merai, a Certified Solution Architect and Public Cloud Specialist with over 7 years in IT. He helped startups in Real Estate, Media Streaming, and On-Demand industries launch successful public cloud projects.

Passionate about Space, Science, and Computers, He also mentors aspiring cloud engineers, shaping the industry's future.

Connect with him on LinkedIn to stay updated on cloud innovations.