Skip to content

Commit

Permalink
update run
Browse files Browse the repository at this point in the history
  • Loading branch information
llitfkitfk committed Oct 10, 2014
1 parent 55055c6 commit 8315d76
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down Expand Up @@ -48,6 +54,12 @@ OPTIONS
//保持输入打开
sudo docker run -i ubuntu /bin/bash
```
* -t

```
//分配一个假的输入终端
sudo docker run -i -t ubuntu /bin/bash
```
* -m

```
Expand All @@ -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

```
//挂载数据卷 格式:(-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
```

0 comments on commit 8315d76

Please sign in to comment.