centos制作Nginx镜像

自定义Nginx镜像

FROM centos:7.7.1908

LABEL maintainer="gms <952726682@qq.com>"

RUN yum install -y epel-release && yum install -y vim wget tree lrzsz gcc gcc-c++ automake proc proc-devel zlib zlib-devel openssl openssl-devel iproute net-tools iotop unzip

ADD nginx-1.16.1.tar.gz /usr/local/src

RUN cd /usr/local/src/nginx-1.16.1 && ./config --prefix=/app/nginx && make && make install && rm -rf nginx-1.16.1

ADD static.zip /apps/nginx/html

RUN cd /apps/nginx/html && unzip static.zip && rm -rf static.zip

ADD nginx.conf /apps/nginx/conf/nginx.conf

EXPOSE 80 443

CMD ["/apps/nginx/sbin/nginx","-g","daemon off;"]

文件目录

tree
.
├── Dockerfile
├── nginx-1.16.1.tar.gz
└── nginx.conf
posted @ 2020-07-05 21:26  Gmiao  阅读(536)  评论(1编辑  收藏  举报