文章来源:nginx
1.拉取镜像docker
# docker pull openresty/openresty
2.启动openresty测试
# docker run -it --name openresty -p 80:80 openresty/openresty
3.复制配置文件删除 openrestyspa
### 建立配置文件夹 # mkdir /data # mkdir /data/openresty # mkdir /data/openresty/conf # 复制配置文件 # docker cp openresty:/usr/local/openresty/nginx/conf/nginx.conf /data/openresty/conf ### 删除 openresty 容器 # docker rm -rf openresty ### 配置启动 openresty # docker run -it -p 80:80 \ --name openresty --restart always \ -v /data/openresty/conf/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf \ -v /etc/localtime:/etc/localtime \ openresty/openresty
4.测试是否成功3d
文章来源:rest