Docker - Start a Container Automatically

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

The restart policy can be specified when the container is started with --restart=always flag.

The container configuration can also be edited directly. The restart policy is specified in /var/lib/docker/containers/<container-id>/hostconfig.json:

...
"RestartPolicy":{"Name":"always","MaximumRetryCount":0},
...