-d

true 或者 false

如果将-d与—rm一起使用,则在容器退出或守护进程退出时(以先发生的为准)移除容器。

docker run -d -p 80:80 my_image nginx -g ‘daemon off;’

-a

=[] : Attach to STDIN, STDOUT and/or STDERR

如果不指定-a,则Docker将同时连接到stdout和stderr。您可以指定要连接到三个标准流(STDIN、STDOUT、STDERR)中的哪一个,如中所示:

-t

Allocate a pseudo-tty

—sig-proxy

=true: Proxy all received signals to the process (non-TTY mode only)

-i

Keep STDIN open even if not attached

对于交互式进程(如shell),必须一起使用-i-t,以便为容器进程分配tty-i-t通常是编写的,您将在后面的示例中看到。当客户端从管道接收其标准输入时,禁止指定-t,如:

—name

Image[:tag]

docker run ubuntu:14.04 运行哪个容器的哪个版本

Image[@digest]

The following example runs a container from the alpine image with the sha256:9cacb71397b640eca97488cf08582ae4e4068513101088e9f96c9814bfda95e0 digest:

docker run alpine@sha256:9cacb71397b640eca97488cf08582ae4e4068513101088e9f96c9814bfda95e0 date

-pid

-uts

—ipc

—restart

docker run —restart=always redis