From 8315d76d39c13b2901da47a199f710ff374d59ed Mon Sep 17 00:00:00 2001 From: llitfkitfk Date: Fri, 10 Oct 2014 13:58:05 +0800 Subject: [PATCH] update run --- run/README.md | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/run/README.md b/run/README.md index fa661bb..f251f18 100644 --- a/run/README.md +++ b/run/README.md @@ -17,6 +17,12 @@ OPTIONS // 如果有error信息 将会输出error信息 sudo docker run -a stderr ubuntu echo test ``` + + ``` + // 如果查看log信息 可以输出信息 + sudo docker run -a stdout ubuntu echo test + sudo docker logs [containerId] + ``` * -c ``` @@ -48,6 +54,12 @@ OPTIONS //保持输入打开 sudo docker run -i ubuntu /bin/bash ``` +* -t + + ``` + //分配一个假的输入终端 + sudo docker run -i -t ubuntu /bin/bash + ``` * -m ``` @@ -58,10 +70,31 @@ OPTIONS * -p ``` - + //映射container端口到host主机 格式:(-p ip:hostPort:containerPort) + sudo docker run -d -p 0.0.0.0:8080:80 ubuntu /bin/bash ``` * -P -* -t + + ``` + //映射container所有暴露的端口到host主机 + sudo docker run -d -P ubuntu /bin/bash + ``` + * -u + + ``` + //设置username + sudo docker run -d -u testusername ubuntu /bin/bash + ``` * -v -* -w \ No newline at end of file + + ``` + //挂载数据卷 格式:(-v /host:/container) + sudo docker run -d -v /tmp/hostvolume:/tmp/ ubuntu /bin/bash + ``` +* -w + + ``` + //设置container内部的工作路径 + sudo docker run -w /path/to/dir/ -i -t ubuntu /bin/bash + ``` \ No newline at end of file