运行容器
podman run -d --name nginx -p 8080:80 docker.io/nginx:latest
Bash生成systemd配置文件
podman generate systemd --new --files nginx
# 输出
# /root/container-90346186cab3adcaf462790c6bf1cdeed045c6129fa28dbed6f9dc9579ccb1da.service
Bash复制systemd配置
mv container-90346186cab3adcaf462790c6bf1cdeed045c6129fa28dbed6f9dc9579ccb1da.service ~/.config/systemd/user/container-nginx.service
Bash重载systemd服务
systemctl --user daemon-reload
Bash启动服务及开机启动
systemctl --user enable sing-box
systemctl --user start sing-box
Bashpodman自动更新
启动时添加label
podman run -d --name nginx -p 8080:80 --label "io.containers.autoupdate=registry" docker.io/nginx:latest
Bash添加systemd服务后执行podman auto-update即可自动更新到最新镜像
podman auto-update
Bash