文章來源: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