I'm working with a Docker container with Debian 11 inside and a server. I need to update this server and do other things on regular manne. I've written several scripts that can do it, but I encountered serious proble. If I want to update the server and other packages I need to reboot the container. I'm obviously able to do so from the computer Docker is installed on (in my case Docker Desktop running with WSL2 on Windows 10), I can reboot the container easily, but I need to automate it. The simplest way will be to add the shutdown command to the scripts I've written. I was reading about it, but found nothing. Is there any way to reboot this container from the Debian inside it? If no, how can it be achieved and how complicated is it?
I was trying to invoke standard Linux commands to shutdown or reboot system on Debian inside container. I expect a guide if it's possible and worth efforts.