centos7 制作openresty docker镜像

这篇博客介绍了如何在CentOS 7环境下,通过Docker制作OpenResty的镜像。首先从CentOS 7的基础镜像开始,然后安装必要的依赖包,接着将OpenResty源码复制到镜像中并进行配置和编译安装。最后,设置环境变量、创建目录、移动配置文件,并使启动脚本可执行,确保Docker容器启动时执行该脚本。镜像对外暴露80和443端口。
摘要由CSDN通过智能技术生成

FROM centos:7

COPY ./start.sh /root/
COPY ./openresty-1.15.8.1 /root/openresty-1.15.8.1
COPY ./conf /root/conf

RUN yum install -y perl perl-devel perl-ExtUtils-Embed pcre-devel openssl openssl-devel gcc readline-devel  GeoIP-devel libreadline-dev libncurses5-dev libpcre3-dev libssl-dev libxml2 libxml2-devel libxslt libxslt-devel  wget make 

RUN cd /root/openresty-1.15.8.1 && chmod +x ./configure && ./configure --prefix=/usr/local/openresty --add-module=./bundle/ngx-uploasd-progress-module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_geoip_module  --with-http_realip_module --with-threads --with-pcre --with-file-aio --with-http_flv_module --with-http_mp4_module --with-luajit \
&& gmake && gmake install

ENV PATH $PATH:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin/

RUN mkdir -p /var/cache/nginx/microcache \
&& mv /usr/local/openresty/nginx/conf /usr/local/openresty/nginx/conf.back \
&& mv /root/conf /usr/local/openresty/nginx/conf

RUN chmod +x /root/start.sh

ENTRYPOINT ["sh","/root/start.sh"]

EXPOSE 80 443

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值