Get Started with Podman
First Things First: Installing Podman
For installing or building Podman, please see the installation instructions:
Getting Help
Help & manpages
For more details, you can review the manpages:
$ man podman
$ man podman subcommand
To get some help and find out how Podman is working, you can use the help.
$ podman --help # get a list of all commands
$ podman subcommand --help # get info on a command
Please also reference the Podman Troubleshooting Guide to find known issues and tips on how to solve common configuration mistakes.
Searching, pulling, and listing images
$ podman search httpd
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/library/httpd The Apache HTTP Server Project 3762 [OK]
docker.io docker.io/centos/httpd-24-centos7 Platform for running Apache h... 40
quay.io quay.io/centos7/httpd-24-centos-7 Platform for running Apache h... 0 [OK]
docker.io docker.io/centos/httpd 34 [OK]
redhat.com registry.access.redhat.com/ubi8/httpd 0
quay.io quay.io/redhattraining/httpd-parent 0 [OK]
$ podman search httpd --filter=is-official
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/library/httpd The Apache HTTP Server Project 3762 [OK]
$ podman pull docker.io/library/httpd
Trying to pull docker.io/library/httpd:latest...
Getting image source signatures
Copying blob ab86dc02235d done
Copying blob ba1caf8ba86c done
Copying blob eff15d958d66 done
Copying blob 635a49ba2501 done
Copying blob 600feb748d3c done
Copying config d294bb32c2 done
Writing manifest to image destination
Storing signatures
d294bb32c2073ecb5fb27e7802a1e5bec334af69cac361c27e6cb8546fdd14e7
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/httpd latest d294bb32c207 12 hours ago 148 MB
Running a container & listing running containers
This sample container will run a very basic httpd server that serves only its index page.
Running a container
$ podman run -dt -p 8080:80/tcp docker.io/library/httpd
Note:
Because the container is being run in detached mode, represented by the -d in the podman run command, Podman will run the container in the background and print the container ID after it has executed the command. The -t also adds a pseudo-tty to run arbitrary commands in an interactive shell.
Also, we use port forwarding to be able to access the HTTP server. For successful running at least slirp4netns v0.3.0 is needed.
Listing running containers
The podman ps
command is used to list created and running containers.
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01c44968199f docker.io/library/httpd:latest httpd-foreground 1 minute ago Up 1 minute 0.0.0.0:8080->80/tcp laughing_bob
Note:
If you add -a
to the podman ps
command, Podman will show all containers (created, exited, running, etc.).
Testing the httpd
container
As you are able to see, the container does not have an IP Address assigned. The container is reachable via its published port on your local machine.
$ curl http://localhost:8080
From another machine, you need to use the IP Address of the host, running the container.
$ curl http://<IP_Address>:8080
Note:
Instead of using curl
, you can also point a browser to http://localhost:8080
.