First, create the container. We run as sudo so that it is available to root.
sudo podman run \
--label="io.containers.autoupdate=image" \
--name=nexus \
--publish="8081:8081" \
--volume="/var/lib/nexus:/sonatype-work:z" \
--detach \
sonatype/nexus:latest
The scripts below are provided for different services.
Then, generate systemd service file.
sudo podman generate systemd --new --files nexus
sudo cp container-XXXXXX.service /etc/systemd/system/nexus.service
sudo systemctl daemon-reload
sudo systemctl enable nexus.service
Delete container so that it can be created by systemd on next start.
sudo podman stop nexus
sudo podman rm nexus
Services may be updated with autoupdate.
sudo podman auto-update