创建服务配置
podman generate systemd --new --name "$CONTAINER_NAME"
mkdir -p ~/.config/systemd/user/
mv -v "container-$CONTAINER_NAME.service" ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable "container-$CONTAINER_NAME.service"
systemctl --user status "container-$CONTAINER_NAME.service"
参考
- https://www.tutorialworks.com/podman-systemd/
- https://github.com/containers/podman/issues/10539
- https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot
- https://stackoverflow.com/questions/65162259/is-there-a-possibility-to-change-restart-policy-of-podman-container