Best way to auto-update podman containers?

I want to start and update a podman container on boot using systemd. First I tried podman-compose but that was just refusing to work probably. So ended I up just making a shell script that the service runs:

podman pull
podman stop nextcloud
podman rm nextcloud
podman run -d \
  --name=nextcloud \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/New_York \
  -p 443:443 \
  -v /home/andythurman/nextcloud/config:/config:Z \
  -v /home/andythurman/nextcloud/data:/data:Z \
  --restart unless-stopped \
podman start -a nextcloud

Is this the best way of doing this? I’m not necessarily a noob to containers, but still have a bit to learn about podman.

You’d better set it up with the auto-update flag and then use the systemd timer functionnality

Please follow this guide:

Regards., HTH

1 Like