Quick & easy containerized web server with Podman - joefidler/joefidler.github.io GitHub Wiki
A quick & simple web server using Podman. Serves files locally from the current directory, for previewing etc.
source: https://hub.docker.com/r/jdkelley/simple-http-server
- Get the latest image:
podman pull docker.io/jdkelley/simple-http-server:latest
- As we are running rootless we can't expose port 80 directly so we use 8000. The volume requires us to set the SELInux context to shared with a :z tag, and the double quotes around the ${PWD} are important as we get a bed reference without them (but I don't know why). To serve the current directory:
podman run --rm \
--name=webserver \
-v "${PWD}":/serve:z \
-p 8000:8000 \
jdkelley/simple-http-server:latest
- Browse to:
127.0.0.1:8000