Server Reboot and Docker, proper way?

Hello,

I’m trying to find the best/proper way to handle docker when restarting my server for dnf upgrades.
At the moment I just do sudo shutdown -r (now)

But I’ve noticed that docker doesn’t seem to gracefully stop containers (as in the server just restarts without the docker containers saves databases etc)

should I be doing `sudo systemctl stop docker’ first
and then run ‘sudo shutdown -r (now)’?

Or how do people handle server restarts?

I used systemctl reboot in auto reboot scripts Fedora and other distros fine on bare-metal server (haven’t tried with containers)

Unfortunately the systemctl reboot (or reboot) commands behaves the same for docker as the shutdown command.

I use podman and not docker itself for my containers and I think podman knows how to handle shutdown. But I almost always stop my VMs before I shutdown.

You could use podman instead of docker if that’s possible for your use case.
You could review the podman service files to see what they implement for shutdown.