[Docker] Run Short-Lived Docker Containers

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[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.

以上是关于[Docker] Run Short-Lived Docker Containers的主要内容,如果未能解决你的问题,请参考以下文章

docker的/var/run/docker.sock参数

Docker run 指令详解

关于/var/run/docker.sock

Docker学习总结之Run命令介绍

Docker命令-docker run

Docker run 命令的使用方法