chapter two

2 Command line

 

This chapter covers

  • The Podman command line
  • Running an OCI application
  • Differences between containers and images
  • Building an OCI Based Image

Podman is an excellent tool for running and building containerized applications. In this chapter, you’ll get started by building a simple web application to demonstrate commonly used features of the Podman command line.

If you don’t have Podman installed on your machine, you can jump to appendix C, Getting Podman, and then return here. This chapter assumes that Podman 4.1 or newer is already installed. Older versions of Podman probably work fine, but all examples were tested with Podman 4.1.

The example base image I use is the registry.access.redhat.com/ubi8/httpd-24 image from Red Hat, my current employer.

Note

Universal Base Images (UBI) can be used anywhere, but container software that is maintained and vetted by Red Hat, and when run on a Red Hat based operating system, is fully supported. There are hundreds of Apache images which work similarly to this image, that you can also try out.

2.1      Working with containers

2.1.1   Exploring containers

2.1.2   Running the containerized application

2.1.3   Stopping containers

2.1.4   Starting containers

2.1.5   Listing containers

2.1.6   Inspecting containers

2.1.7   Removing containers

2.1.8   Execing into a container

2.1.9   Creating an image from a container      

2.2      Working with container images

2.2.1   Difference between a container and an image

2.2.2   Listing images

2.2.3   Inspecting images

2.2.4   Pushing images

2.2.5   podman login (Logging into a container registry)

2.2.6   Tagging images

2.2.7   Removing images

2.2.8   Pulling images

2.2.9   Searching for images