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-toolsmeta-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
-ioption creates an interactive session. Without the-ioption, the shell opens and then exits. - The
-toption opens a command-line session. Without the-toption, the shell stays open, but you cannot type anything to the shell. - The
--rmoption removes thequay.io/<namespace>/<image>:<tag>container image after the container exits.
Results
- List all running containers:
$ podman psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7ccd6001166e quay.io/<namespace>/<image>:<tag> /sbin/init 6 seconds ago Up 5 seconds ago mybootc