# 21.0 How to Podman Containers are packages of software that contain all of the necessary elements to run in any environment. In this way, containers virtualize the operating system and run anywhere, from a private data center to the public cloud or even on a developer's personal laptop. Docker Zero to Hero: https://youtu.be/3c-iBn73dDE ### Podman First we need to install Podman: ```bash dnf install podman -y ``` Let's find a httpd image: ```bash podman search httpd ``` That is a lot of results we want a specific image namely the apache official one. found here: https://hub.docker.com/_/httpd The one we want is the following: ```bash podman search docker.io/library/httpd ``` We can get the image by using a docker pull: ```bash podman pull httpd ``` The pull should look like this: ```bash [root@rhcsa ~]# podman pull httpd ✔ docker.io/library/httpd:latest Trying to pull docker.io/library/httpd:latest... Getting image source signatures Copying blob 31b3f1ad4ce1 done Copying blob 5bfb2ce98078 done Copying blob f29089ecfcbf done Copying blob a9fcd580ef1c done Copying blob a19138bf3164 done Copying config f2789344c5 done Writing manifest to image destination Storing signatures f2789344c57324805883b174676365eb807fdb4eccfb9878fbb19054fd0c7b7e ``` Let's see if it worked out: ```bash podman image list ``` Output should be as this: ```bash [root@rhcsa ~]# podman image list REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/httpd latest f2789344c573 2 weeks ago 150 MB ``` Great now we have the image downloaded now we need to run it and test it: ```bash podman run -d -it --name httpd -p 8080:80 httpd ``` |flag|Action| |:-|:-| |run|run the container| |-d|run in detached modus| |-i|When set to true, keep stdin open even if not attached. The default is false.| |-t|when set to true, Podman will allocate a pseudo-tty and attach to the standard input of the container. This can be used, for example, to run a throwaway interactive shell.| |--name| sets a name for the run| |-p|Open a port from the container to the vm running the container local-port:container-port| |httpd|the name of the image| Test the container: ```bash curl localhost:8080 ``` ```bash [root@rhcsa ~]# curl localhost:8080