提交 1a784a4d 编写于 作者: F feilong

fix bug

上级 9fc631aa
......@@ -10,7 +10,7 @@ docker image pull library/ubuntu
下载 ubuntu 镜像成功
![](https://gitcode.net/csdn/skill_tree_cloud_native/-/raw/master/data/1.云原生初阶/1.容器(docker)/3.docker container 操作/container-run-bash-ubuntu.jpg.jpg)
![](https://gitcode.net/csdn/skill_tree_cloud_native/-/raw/master/data/1.云原生初阶/1.容器(docker)/3.docker container 操作/container-run-bash-ubuntu.jpg)
<br/>
接着,启动container 并执行第一个程序`bin/bash`:
......
......@@ -10,57 +10,6 @@ docker container run -it hello-world
可以看到输出了Hello World 信息:
# docker caontainer 操作(2): 运行,进入交互式shell环境
一个Docker镜像(image)运行后,就是一个容器实例,称为`container`
运行容器后可以通过参数指定执行的第一个程序,例如可以先拉取`ubuntu`的容器镜像
```bash
docker image pull library/ubuntu
```
下载 ubuntu 镜像成功
![](https://gitcode.net/csdn/skill_tree_cloud_native/-/raw/master/data/1.云原生初阶/1.容器(docker)/3.docker container 操作/container-run-bash-ubuntu.jpg.jpg)
<br/>
接着,启动container 并执行第一个程序`bin/bash`:
```bash
docker container run -it ubuntu bin/bash
```
可以看到成功进入了ubuntu容器实例的shell环境,并在shell环境里执行了`ls``ll`命令。
![](https://gitcode.net/csdn/skill_tree_cloud_native/-/raw/master/data/1.云原生初阶/1.容器(docker)/3.docker container 操作/container-run-bash-ubuntu-shell.jpg)
<br/>
以下描述错误的是?
## 答案
所有的容器都能执行 `/bin/bash` 程序
## 选项
### A
可以在启动容器的时候指定执行的第一个程序
### B
如果容器程序带有 bash 程序,就可以在启动的时候指定执行bash程序从而进入容器里的shell环境。
### C
因为指定了参数`-it`,因此可以直接在启动容器的终端上输入命令,回车交给容器里的shell环境执行命令。
![](https://gitcode.net/csdn/skill_tree_cloud_native/-/raw/master/data/1.云原生初阶/1.容器(docker)/3.docker container 操作/container-run-simple.jpg)
<br/>
参数`-it`表示将容器的shell链接到当前终端。
以下描述错误的是?
## 答案
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册