Cyclic docker container restart (linux server)

Viewed 132

So i want to cyclically restart my docker container (once a week - let's say Sunday, 22:00) Does anyone know how to call docker restart ID every Sunday?

1 Answers

You could set up a restart policy with the docker run command, and use the -d parameter which Docker recommends,

More information in the docker documentation, https://docs.docker.com/config/containers/start-containers-automatically/

Update:

  1. Create a cron job to restart the docker container on Sunday at 22:00.
  2. The Docker restart policy should start the container again.
  3. Create an anacron job inside the container, to launch your program after the Docker container starts again.
Related