docker_practice/container/run.md

62 lines
2.2 KiB
Go
Raw Permalink Normal View History

#
`exited`
Docker
2014-09-17 20:26:35 +08:00
##
`docker run`
2014-09-15 21:25:36 +08:00
Hello World
2017-11-22 11:13:23 +08:00
```bash
2018-12-19 17:24:52 +08:00
$ docker run ubuntu:18.04 /bin/echo 'Hello world'
2014-09-15 21:25:36 +08:00
Hello world
```
`/bin/echo 'hello world'`
2014-09-15 21:25:36 +08:00
bash
2017-11-22 11:13:23 +08:00
```bash
2018-12-19 17:24:52 +08:00
$ docker run -t -i ubuntu:18.04 /bin/bash
2014-09-15 21:25:36 +08:00
root@af8bae53bdd3:/#
```
`-t` Dockerpseudo-tty `-i`
2014-09-15 21:25:36 +08:00
2017-11-22 11:13:23 +08:00
```bash
2014-09-15 21:25:36 +08:00
root@af8bae53bdd3:/# pwd
/
root@af8bae53bdd3:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
```
`docker run` Docker
2014-09-15 21:25:36 +08:00
* [registry](../repository/README.md)
2014-09-15 21:25:36 +08:00
*
*
* 宿
* ip
2014-09-15 21:25:36 +08:00
*
2014-09-17 20:26:35 +08:00
*
2014-09-15 21:25:36 +08:00
##
`docker container start` `exited`
2014-09-15 21:25:36 +08:00
`ps` `top`
2017-11-22 11:13:23 +08:00
```bash
2014-09-15 21:25:36 +08:00
root@ba267838cc1b:/# ps
PID TTY TIME CMD
1 ? 00:00:00 bash
11 ? 00:00:00 ps
```
bash 使 Docker