PS C:\Users\Administrator> docker pull nginx
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
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
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