# 创建用户 RUN groupadd www RUN useradd -g www www -s /bin/false
# 定义Nginx版本号 ENV VERSION 1.14.2
# 下载并解压文件 RUN mkdir -p /usr/local/src/ ADD http://nginx.org/download/nginx-$VERSION.tar.gz /usr/local/src RUN tar -xvf /usr/local/src/nginx-$VERSION.tar.gz -C /usr/local/src/
# 创建安装目录 ENV NGINX_HOME /usr/local/nginx RUN mkdir -p $NGINX_HOME RUN chown -R www:www $NGINX_HOME
# 进入解压目录 WORKDIR /usr/local/src/nginx-$VERSION
# 编译安装 RUN ./configure \ --user=www \ --group=www \ --prefix=$NGINX_HOME \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module RUN make RUN make install
# 备份Nginx的配置文件 RUN mv $NGINX_HOME/conf/nginx.conf $NGINX_HOME/conf/nginx.conf.default
# 设置环境变量 ENV PATH $PATH:$NGINX_HOME/sbin
# 创建WebApp目录 ENV WEB_APP /usr/share/nginx/html RUN mkdir -p $WEB_APP
# 安装软件 RUN yum -y update && yum -y install vim tree htop tmux net-tools telnet wget curl supervistor autoconf git gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
# 创建用户 RUN groupadd tengine RUN useradd -g tengine tengine
# 定义Tengine版本号 ENV VERSION 2.2.3
# 下载并解压文件 RUN mkdir -p /usr/local/src/ ADD http://tengine.taobao.org/download/tengine-$VERSION.tar.gz /usr/local/src RUN tar -xvf /usr/local/src/tengine-$VERSION.tar.gz -C /usr/local/src/
# 创建安装目录 ENV TENGINE_HOME /usr/local/tengine RUN mkdir -p $TENGINE_HOME
# 进入解压目录 WORKDIR /usr/local/src/tengine-$VERSION
# 编译安装 RUN ./configure \ --user=tengine \ --group=tengine \ --prefix=$TENGINE_HOME \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_concat_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-http_upstream_consistent_hash_module RUN make RUN make install
# 备份Tengine的配置文件 RUN mv $TENGINE_HOME/conf/nginx.conf $TENGINE_HOME/conf/nginx.conf.default
# 设置环境变量 ENV PATH $PATH:$TENGINE_HOME/sbin
# 创建WebApp目录 ENV WEB_APP /usr/share/tengine/html RUN mkdir -p $WEB_APP