Verified Commit d2a194aa authored by tr's avatar tr
Browse files

Build modsecurity

parent b86fb96c
FROM centos:8 AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
RUN dnf install -y epel-release sudo && \
dnf groupinstall -y 'Development Tools' 'RPM Development Tools' && \
rm -rf /var/cache/* /var/log/*
RUN useradd user && \
usermod -aG wheel user && \
sed -e '/^%wheel.*/d' -e 's/^# \(%wheel.*\)/\1/' -i /etc/sudoers && \
chown user:user /usr/local/src
USER user
WORKDIR /home/user
ENV LC_ALL C
# Build modsecurity
ENV MODSECURITY_VERSION 3.0.4
RUN sudo dnf install -y libcurl-devel libxml2-devel pcre-devel && \
sudo rm -rf /var/cache/* /var/log/*
RUN curl -L https://github.com/SpiderLabs/ModSecurity/releases/download/v$MODSECURITY_VERSION/modsecurity-v$MODSECURITY_VERSION.tar.gz \
-o /usr/local/src/modsecurity.tar.gz && \
tar -zxC /usr/local/src -f /usr/local/src/modsecurity.tar.gz
RUN cd /usr/local/src/modsecurity-v$MODSECURITY_VERSION && \
./build.sh && \
./configure && \
make && \
sudo make install
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment