- This tutorial is available in an Oracle-provided free lab environment.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Get started with Podman
This lab gets you started using Podman on Oracle Linux 8. 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 system with Oracle Linux 8 installed
(Hands-on Lab) Connect to the Compute Instance
Note: This step is specific to the Oracle provided free lab environment.
To access the lab compute instance, first connect to the Oracle Cloud Infrastructure (OCI) Console and copy the compute instance Public IP address.
- Sign in to OCI Console, and select your Compartment.
- Click Instances.
Copy the Public IP to a temporary location (such as a text file) on your computer.
To copy, highlight the IP address with the mouse and press Ctrl+C.
- Right-click the Virtual Desktop and select Open Terminal Here.
Connect to the instance.
ssh -i ../.ssh/id_rsa opc@<IP_ADDRESS_OF_COMPUTE_INSTANCE>
<IP_ADDRESS_OF_COMPUTE_INSTANCE>is the IP address copied from the OCI Console.
Accept the ECDSA key fingerprint.
You are now connected to the compute instance for this lab.
Install the Podman Package
- Open a terminal and connect to your Oracle Linux 8 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 8 Slim Image
Container images are hosted in a repository. By default, podman and skopeo on Oracle Linux 8 are configured to use the Oracle Container Registry, Docker Hub, Quay.io, Fedora, and CentOS registries.
Start by listing the existing images in local storage.
Next, pull the
podman pull os/oraclelinux:8-slim
- The image downloads to local system storage.
Verify the image downloaded.
Run the Oracle Linux 8 Slim Image
Start a container using the
oraclelinux:8-slim image. The container in this lab will run an interactive bash terminal.
Create a 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 8 Slim image.
podman rmi <IMAGE_ID>
Where the <IMAGE_ID> is determined by running
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Get started with Podman
Copyright © 2021, Oracle and/or its affiliates.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.