default restart policy docker container code example
Example 1: docker run restart on boot
$ docker run -d --restart unless-stopped <image>
Example 2: run host command from docker container
docker run --rm -v $(pwd)/mybashscript.sh:/mybashscript.sh ubuntu bash /mybashscript.sh