How do I make a Docker container start automatically on system boot?

Supposed I have a Docker container that I want to run, then I can call

$ docker run ...

and everything is fine. Is there a built-in way to run a container in a way that it will be restarted automatically, if the system crashes and reboots?

If so, is this also available in Docker Compose?

12 Answers
12

Leave a Comment