docker 安装 openresty

文章来源:

1.拉取镜像

# docker pull openresty/openresty

2.启动openresty

# docker run -it --name openresty -p 80:80 openresty/openresty

3.复制配置文件删除 openresty

### 创建配置文件夹
# 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.测试是否成功

文章来源:

原文地址:https://www.cnblogs.com/hello-tl/p/9295086.html