docker --restart example

C++
$ docker run -d --restart unless-stopped <image># To limit retart attempt, add [:int]
docker run -d --restart=on-failure:3
Source

Also in C++: