一、执行启动步骤

   部分参数可去掉

  • docker run -dit -p 80:80 -v /docker.container.map/nginx/etc/nginx/conf.d:/etc/nginx/conf.d  --name nginx 46102226f2fd /bin/bash
  • docker exec -it 3e9b1d2a7665 bash
  • /usr/sbin/nginx

二、如果nginx容器内不支持vi命令,则进行如下操作

 (一)、配置国内镜像源

实际在使用过程中,运行 apt-get update,然后执行 apt-get install -y vim,下载地址由于是海外地址,下载速度异常慢而且可能中断更新流程,所以做下面配置:

  • mv /etc/apt/sources.list /etc/apt/sources.list.bak
  • echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
  • echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
  • echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
  • echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

    (二)、执行更新和安装命令 

  • apt-get update
  • apt-get install -y vim

 

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐