docker run --rm --name my_services --restart=unless-stopped code example
Example: docker --restart example
# To limit retart attempt, add [:int]
docker run -d --restart=on-failure:3
# To limit retart attempt, add [:int]
docker run -d --restart=on-failure:3