When exploring containers, deploying a simple application like freshrss is a great application to get started with: it's easy to deploy and is useful.
Deploying freshrss as a container will allow you to host and maintain your own data. The application will be available across your local network via a web browser.
You can learn more about freshrss at their site: https://www.freshrss.org/
The image I am going to use in this example comes from LinuxServer.io https://hub.docker.com/r/linuxserver/freshrss
LinuxServer.io is a great resource because they are images built from the open source repos and they don't include additional telemetry to tracking services.
Let's get started:
Below is the first command we are going to run:
podman create \
-e TZ=America/New_York \
-p 80:80 \
-v /path/to/files:/config \
Let's break it down:
- podman create = create (but don't run) a new container with the following attributes
- --name = define a name for your container
- -e = set environment variable, in this case, we are setting timezone
- -p = port binding: bind host port 6000 to port 80 inside the container
- -v = map files from the host system to inside the container; this is to ensure that files generated from the container will survive if the container is destroyed
- linuxserver/freshrss = this is the image we will be using
Since we used the podman-create command, and not podman-run, the container is not yet running, but we will get there in a moment.
After creating the container, let's integrate it with systemd so our host system can monitor the container. This will give us a few benefits, including: start at boot and integrated system log monitoring. And of course, this method is all rootless! First, we will create a systemd unit file:
$ podman generate systemd --name freshrss > $HOME/.config/systemd/user/freshrss.service
Reload systemd so it can "pick up" the new unit file:
$ systemctl --user daemon-reload
Finally, enable the unit file to start when the host system boots, and start the container "now":
$ systemctl --user enable --now freshrss.service
Now you should be able to access the container by opening your web browser and navigating to http://localhost. You will only be able to access this application from your local computer. To access it from outside your local network you will need to setup a revserse proxy via nginx, apache, or traefik.
All done! Have fun!
2020-08-19: updated to use user level systemd commands