[Docker] Run Short-Lived Docker Containers

Learn the benefits of running one-off, short-lived Docker containers. Short-Lived containers are useful to execute one-line commands or setup scheduled tasks. We'll demonstrate setting up a cronjob from the host machine to tap into the benefits of running automated, timed scripts with Docker.

docker --rm ngnix ngnix -h  // run short live ngnix container with command ngnix -h

This command will run ngnix container a short time, and exist after running.

原文地址:https://www.cnblogs.com/Answer1215/p/6124321.html