docker启动nginx镜像无法访问【No logs available】问题解决方案
一、执行启动步骤部分参数可去掉docker run -dit -p 80:80 -v /docker.container.map/nginx/etc/nginx/conf.d:/etc/nginx/conf.d --name nginx 46102226f2fd /bin/bashdocker exec -it 3e9b1d2a7665 bash/usr/sbin/ngin...
·
一、执行启动步骤
部分参数可去掉
- 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
更多推荐
已为社区贡献1条内容
所有评论(0)