anchor.diff:  ENV NGINX_EXTRA_MODULES=" --with-http_realip_module --with-http_ssl_module "
   ENV LC_ALL=C
   
  -# Mod Security
  -RUN git clone https://github.com/SpiderLabs/ModSecurity.git \
  +# 1 Install required dependencies
  +# 2 Compile Mod Security
  +# 3 Get Mod security configs
  +# 4 Compile Nginx
  +RUN yum -y groups mark convert \
  +    && yum clean all && yum -y swap fakesystemd systemd \
  +    && echo "#### Install required dependencies ####" \
  +    && yum -y --setopt=group_command=objects groupinstall 'Development Tools' \
  +    && yum -y install gcc-c++ pcre-dev pcre-devel zlib-devel make unzip httpd-devel libxml2 libxml2-devel wget openssl-devel \
  +    && echo "#### Compile Mod Security ####" \
  +    && git clone https://github.com/SpiderLabs/ModSecurity.git \
       && cd ModSecurity \
       && git checkout tags/v${MODSEC_VERSION} \
       && ./autogen.sh \
       && ./configure --enable-standalone-module --disable-mlogc \
       && make \
  -    && make install
  -
  -# Mod security configs
  -RUN wget https://raw.githubusercontent.com/SpiderLabs/ModSecurity/master/modsecurity.conf-recommended \
  +    && make install \
  +    && cd .. \
  +    && wget https://raw.githubusercontent.com/SpiderLabs/ModSecurity/master/modsecurity.conf-recommended \
       && mkdir -p /etc/nginx \
       && cat modsecurity.conf-recommended  > /etc/nginx/modsecurity.conf \
  +    && echo "#### Get Mod security configs ####" \
       && wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master -O owasp-modsecurity-crs.tar.gz \
       && tar -xvzf owasp-modsecurity-crs.tar.gz \
       && CRS_DIR=$(find . -type d -name SpiderLabs-owasp-modsecurity-crs*) \
  
positive.code: 
  MAINTAINER dan78uk
  
  # Install required dependencies
  RUN yum -y groups mark convert \
      && yum clean all && yum -y swap fakesystemd systemd \
      && yum -y groupinstall 'Development Tools' && yum -y clean all \
      && yum -y install gcc-c++ pcre-dev pcre-devel zlib-devel make unzip httpd-devel libxml2 libxml2-devel wget openssl-devel \
      && yum -y clean all
  
  # Set working dir
  ENV WORKING_DIRECTORY=/opt/nginx_mod_security
  RUN mkdir -p $WORKING_DIRECTORY
  WORKDIR /opt/nginx_mod_security
  
  # ENV build variables
  ENV LANG C.UTF-8
  
negative.code:     && cat ${CRS_DIR}/base_rules/modsecurity_*.conf >> /etc/nginx/modsecurity.conf \
      && cp ${CRS_DIR}/base_rules/*.data /etc/nginx/ \
      && cp ModSecurity/unicode.mapping /etc/nginx/unicode.mapping \
      && echo "#### Compile Nginx ####" \
      && wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
      && tar -xvzf nginx-${NGINX_VERSION}.tar.gz \
      && cd nginx-${NGINX_VERSION}/ \
      && ./configure $NGINX_ADD_MODULES $NGINX_EXTRA_MODULES \
      && make \
      && make install \
      && cd .. \
      && echo "#### Clean Solution ####" \
      && yum -y --setopt=group_command=objects groupremove 'Development Tools' \
      && yum -y autoremove \
      && yum -y remove *-devel \
      && yum -y clean all \
      && rm -rf $WORKING_DIRECTORY
  
  # Link nginx and clean solution
  RUN ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx \
      && cp /usr/local/nginx/conf/*.* /etc/nginx/
  WORKDIR /etc/nginx
  
  # Check Nginx installation
  RUN nginx -V
  