基于centos 7 做的Nginx-1.14.0的docker镜像

2020年1月8日11:13:07 评论
前言

基于centos 7 做的Nginx-1.14.0的docker镜像

FROM centos:7

MAINTAINER gr

WORKDIR /usr/local/src

RUN    yum -y install wget && cd /etc/yum.repos.d/ && rm -rf ./* \
       && wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo \
       && sed  -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo \
       && wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo \
       && sed -i '/aliyuncs/d' /etc/yum.repos.d/epel.repo \
       && yum clean all && yum makecache \

RUN yum -y install wget && groupadd www && useradd -g www www && \
    yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre pcre-devel unzip gd-devel GeoIP GeoIP-devel GeoIP-data && yum clean all && \
    wget https://github.com/alibaba/nginx-http-concat/archive/master.zip -O nginx-http-concat-master.zip && unzip nginx-http-concat-master.zip && \
    wget http://nginx.org/download/nginx-1.14.0.tar.gz && tar -zxvf nginx-1.14.0.tar.gz && cd nginx-1.14.0 && \
    ./configure --prefix=/usr/local/nginx-1.14.0 --with-poll_module --with-http_ssl_module --with-http_v2_module \
    --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_geoip_module \
    --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module \
    --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module \
    --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-stream --with-stream_ssl_module \
    --with-mail --with-mail_ssl_module --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module \
    --add-module=../nginx-http-concat-master && make install && ln -s /usr/local/nginx-1.14.0 /usr/local/nginx

RUN /usr/local/nginx/sbin/nginx && echo "daemon off;">>/usr/local/nginx/conf/nginx.conf

ADD run-1.14.sh /usr/local/sbin/run-1.14.sh

RUN chmod -R 755 /usr/local/sbin/run-1.14.sh && \
    rm -rf /var/cache /usr/local/src


EXPOSE 80 443

CMD ["/usr/local/sbin/run-1.14.sh"]
weinxin
我的微信
这是我的微信扫一扫

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: