Docker 安装
1.拉取镜像
PS C:\Users\Administrator> docker pull nginx
2.创建挂载目录
PS C:\Users\Administrator> mkdir -p /docker/nginx/conf
PS C:\Users\Administrator> mkdir -p /docker/nginx/logs
PS C:\Users\Administrator> mkdir -p /docker/nginx/conf.d
PS C:\Users\Administrator> mkdir -p /docker/nginx/html
下载Windows版的nginx,把配置文件拷贝到 /docker/nginx/conf 这个目录下
另外一种方式获取配置文件等内容
## 启动测试容器
PS C:\Users\Administrator> docker run --name test -d nginx
## 复制配置文件
docker cp test:/etc/nginx/nginx.conf /docker/nginx/conf/
docker cp test:/etc/nginx/conf.d/default.conf /docker/nginx/conf.d
3.启动容器
PS C:\Users\Administrator> docker run -d --name nginx -p 9000:80 -v C:\docker\nginx\conf\nginx.conf:/etc/nginx/nginx.conf -v C:\docker\nginx\logs\:/var/log/nginx -v C:\docker\nginx\conf.d\:/etc/nginx/conf.d nginx
使用VIM和PS命令
PS C:\Users\Administrator> docker exec -it nginx /bin/bash
root@33b35a61ce59:/# apt-get update
root@33b35a61ce59:/# apt-get install vim
root@33b35a61ce59:/# apt-get install procps
标签:PS,教程,Users,nginx,Administrator,Nginx,conf,Docker,docker
From: https://www.cnblogs.com/wml-it/p/17653223.html