RH134 Ch 11: Run Containers with Podman

WebAsha's documentation team wants its docs site in a container. Run it with a published port and a host directory, pass configuration through environment variables, make the site a systemd service that starts at boot, and give the student account its own rootless container.

Tasks

  1. Run a detached container named docs from localhost/webasha/pyweb:1.0. Publish host port 8080 to container port 8000, and mount the host directory /srv/docs on /var/www in the container.
  2. Run a container named cfgtest from the same image with the environment variable APPENV=training, running the command printenv APPENV.
  3. Find the Python version inside the running docs container and save the output of python3 -V from the container in /root/pyver.txt.
  4. Run the docs site as the systemd service webdocs.service: a container named webdocs from the same image, host port 8081 to container port 8000, /srv/docs mounted on /var/www, started now and at boot. Use a Quadlet file /etc/containers/systemd/webdocs.container.
  5. As user student, run a rootless detached container named myshell from localhost/webasha/pyweb:1.0 with the command sleep infinity.