2.4. Running a container image
To run and test your container, use the podman run command.
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
Run the container by using the
podman runcommand with the appropriate options. For example, to run the container namedmybootcbased on thequay.io/<namespace>/<image>:<tag>container image:$ 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 terminal 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.
-
The
Verification
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