Running a Container as a Systemd Service on Fedora and RHEL
Running a Container as a Systemd Service on Fedora and RHEL
There is some great documentation on this:
Even better there is a man page:
$ man podman-generate-systemd
The basic command looks like this, to be run on an existing running container:
$ podman generate systemd --name myfedora > ~/.config/systemd/user
Then stop the same container so we can test the systemd startup:
$ podman stop --name myfedora $ systemctl --user start container-myfedora.service
To enable this at bootup:
$ systemctl --user enable container-myfedora.service