自定义Nginx镜像

自定义Nginx镜像

FROM centos:7.7.1908

LABEL maintainer="gms <[email protected]>"

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

你可能感兴趣的:(自定义Nginx镜像)