1.启动nginx
docker start nginx

2.进入nginx
cd /usr/share/nginx/html

3.vim index.html
说明:没有vim命令,docker镜像只保留了基本的功能(文件)。
4.解决方法
数据卷:是一个虚拟目录,是容器内目录与宿主机目录之间映射的桥梁。


说明:在执行docker run命令时,使用-v数据卷:容器内目录可以完成数据卷挂载
当创建容器时,如果挂载了数据卷且数据卷不存在,会自动创建数据卷。
4.1创建docker容器
docker run -d --name nginx -p 80:80 -v html:/usr/share/nginx/html nginx
4.2宿主卷映射的位置
docker volume inspect html

4.3通过MbaXterm连接
说明:找到文件并修改。

5.成功修改
