Get started with Podman
This lab gets you started using Podman on Oracle Linux 8 or later. You will install Podman, pull an image from a repository, and use the image to run a container.
In this lab, you'll:
- Install Podman
- Pull an image from a repository
- Run a container using the pulled image
What Do You Need?
- A running system with Oracle Linux installed
Install the Podman Package
Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions.
Open a terminal and connect to your Oracle Linux instance.
Install the container-tools module.
sudo dnf module install container-tools:ol8
This command will install the container-tools module which contains podman (if not already installed) and other tools, including skopeo and buildah.
One essential tool is container-selinux which allows running
podmanas a non-root user on a SELinux enabled system.
Dnf will display the container-tools module information, including a list of packages that will be installed and any dependencies.
yto proceed with the installation.
Installation of the container-tools module completes.
Check the podman configuration and version.
The Podman commands can be run as a regular user, or as a sudo user with elevated privileges. To see further command details use the podman manual pages.
Pull the Oracle Linux Slim Image
Container images are hosted in a repository. By default, podman and skopeo on Oracle Linux are configured to use the Oracle Container Registry, Docker Hub, Quay.io, Fedora, and CentOS registries.
Listing the existing images in local storage.
podman pull os/oraclelinux:8-slim
The image downloads to local system storage.
Verify the image downloaded.
Run the Oracle Linux Slim Image
Start a container using the
oraclelinux:8-slim image. The container in this lab will run an interactive bash terminal.
Create an interactive container running the bash shell.
podman run --rm -it oraclelinux:8-slim
You are presented a bash terminal where you can run Linux commands within the container.
Exit the container.
The container is automatically removed after execution due to using the
Run the same command again, without the
podman run -it oraclelinux:8-slim
Exit the container as before.
Get a list of all containers in local storage.
podman ps -a
-aensures the output shows both running and non-running containers.
Remove Existing Container and Image
Remove the container and image used in the lab leaving a clean environment.
Remove the container created.
podman rm <CONTAINER_ID>
Where the <CONTAINER_ID> is determined by running
podman ps -a.
Verify the container was removed.
podman ps -a
Remove the downloaded Oracle Linux Slim image.
podman rmi <IMAGE_ID>
Where the <IMAGE_ID> is determined by running