Run a container image

You can run a Red Hat Enterprise Linux container image to run your application or validate your operating system build in an isolated environment. By launching the container, you can verify the system behavior and configurations without modifying the host infrastructure.

Before you begin

  • The container-tools meta-package is installed.

Procedure

Run the container by using the podman run command with the appropriate options. For example, to run the container named mybootc based on the quay.io/<namespace>/<image>:<tag> container image:
$ sudo podman run -it --rm --name mybootc quay.io/<namespace>/<image>:<tag> /bin/bash
  • The -i option creates an interactive session. Without the -i option, the shell opens and then exits.
  • The -t option opens a command-line session. Without the -t option, the shell stays open, but you cannot type anything to the shell.
  • The --rm option removes the quay.io/<namespace>/<image>:<tag> container image after the container exits.

Results

  • List all running containers:
    $ podman ps
    CONTAINER ID  IMAGE                                    COMMAND          CREATED        STATUS            PORTS   NAMES
    7ccd6001166e  quay.io/<namespace>/<image>:<tag>  /sbin/init  6 seconds ago  Up 5 seconds ago          mybootc