Podman, or Pod Manager Tool, is an open-source container engine without a daemon for developing, managing, and running OCI containers on our Linux system. The Podman utility is also available as part of the libpod library. With the recent change in Docker's license, it can become a good alternative available for use on most Linux systems, including the Ubuntu 20.04 LTS image.
Requirements
- A Cloud server running Ubuntu 20.04.
- Root access
Since Podman is not available through Ubuntu's default repository, we need to add the kubic repository to download the podman package. Then it can be installed through any of Ubuntu's package managers like apt or apt-get. Use the following command to add the repository.
# source /etc/os-release # sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
Next, we download and add the GPG key using the following command.
# wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | apt-key add -
We update the repository
# apt-get update -qq -y
Install podman
Now you can download and install the podman package from the configured repository using the command apt-get -y install podman as shown below. This will install the package along with all its dependencies.
# apt-get -y install podman
Verify Podman version
# podman --version
Working with OCI registries
Podman supports multiple container registries from which it can pull container images. When specifying the container name that does not contain a registry, Podman looks up a list of registries in the registry configuration file (/etc/containers/registries.conf) to pull the container image from.
You can add different available container image registries like docker.io (you can also add other registries) in the configuration file.
Edit the file /etc/containers/registries.conf:
# nano /etc/containers/registries.conf
Paste the following content at the end of the file and save.
[registries.insecure]
registries = [ ]
# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
# Docker only
[registries.block]
registries = [ ]
Working with Podman images
In this section, we'll show you how to search for, pull images, and run a container with the Podman command.
# podman search ubuntu-20.04
You should see all Ubuntu 20.04 images in the following output:
To pull images with Podman you can run the command podman pull.
In the example, we pull the latest version of the nginx image: The output shows that the latest version of nginx is pulled from the Docker registry.
# podman pull nginx
To list the downloaded Podman images, run the following command:
# podman images
To list the running Podman container on the system, run the command:
# podman ps -a
Remember, if you have inquiries about this or any other issue related to your servers on Clouding, don't hesitate to write to support@clouding.io We are by your side for whatever you need, consult us!