docker中nginx常用临时地址
conf: /etc/nginx/nginx.conf
html: /usr/share/nginx/html
log: /var/log/nginx
启动临时容器:
docker run --name my-nginx -d nginx
在本地新建文件目录如上图
docker cp my-nginx:/etc/nginx/nginx.conf /usr/local/docker/nginx/conf/nginx.conf
docker cp -a my-nginx:/usr/share/nginx/html /usr/local/docker/nginx
docker cp my-nginx:/etc/nginx/conf.d /usr/local/docker/nginx/conf.d
删除临时容器:
docker rm -f my-nginx
重新配置一个:
docker run --name mynignx -e TZ="Asia/Shanghai" -d -p 89:80 -v /usr/local/docker/nginx/html:/usr/share/nginx/html -v /usr/local/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /usr/local/docker/nginx/conf.d:/etc/nginx/conf.d -v /usr/local/docker/nginx/log:/var/log/nginx nginx
标签:启动,etc,nginx,usr,conf,docker,local
From: https://www.cnblogs.com/q1359720840/p/17702836.html