Running HTTPD as an ordinary user using Podman

While it is always tempting to run a program as root, we know we should not do it. When developing, you want to make the process as non-root as possible. Here is what I am doing to write mod_wsgi code and run it as a non root user.

See my last article for the code I am running.

To Build the container image:

podman build --tag admiyo:krbocp -f Dockerfile

Nothing strange there, but worth noting that the build is done as the ayoung user, not as root.

To run the container:

podman run  -P --name krbocp  --rm admiyo:krbocp

To find the ip/port of the container:

podman port -l

Which looks like this:

$ podman port -l
8080/tcp ->
$ curl

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.