echo "*" > .dockerignorevi DockerfileFROM centos:7MAINTAINER "Geray <1690014753@qq.com>"RUN yum -y install telnet wget iproute net-tools \ kde-l10n-Chinese reinstall glibc-common && \ # 安装nginx依赖 yum -y install gcc gcc-c++ openssl-devel pcre-devel gd-devel make && \ yum clean all && \ rm -rf /var/cache/yum/* && \ localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 && \ cat /dev/null > /etc/locale.conf && echo "LC_ALL=\"zh_CN.UTF-8\"" > /etc/locale.confENV NGINX_VERSION 1.18.0RUN wget https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \ tar -xf nginx-$NGINX_VERSION.tar.gz && \ cd nginx-$NGINX_VERSION && \ ./configure --prefix=/usr/local/nginx \ --with-http_ssl_module \ --with-http_stub_status_module && \ make -j 4 && make install && \ #rm -rf /usr/local/nginx/html/* && \ echo "ok" > /usr/local/nginx/html/status.html && \ cd / && rm -rf nginx-$NGINX_VERSION* #env ENV TZ "Asia/Shanghai" #ENV LANG en_US.UTF-8 ENV LANG zh_CN.UTF-8ENV PATH $PATH:/usr/local/nginx/sbinWORKDIR /usr/local/nginxEXPOSE 80CMD ["nginx", "-g", "daemon off;"]
export NGINX_VERSION=1.18.0docker build -t geray/nginx:v${NGINX_VERSION} .