Skip to content

Commit 8f95a50

Browse files
author
root
committed
add dockerfile
1 parent 5231b1f commit 8f95a50

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM registry.jxit.net.cn:5000/alpine:3.19.1 AS builder
2+
3+
RUN apk update && \
4+
apk add tcpdump vim curl bash build-base gcc zlib-dev tzdata && \
5+
apk add automake autoconf libtool make curl-dev libxml2-dev pcre-dev && \
6+
apk add git linux-headers subversion libmaxminddb-dev geoip-dev yajl-dev pcre2-dev && \
7+
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
8+
echo "Asia/Shanghai" > /etc/timezone
9+
10+
VOLUME /ms
11+
WORKDIR /ms
12+
13+
RUN git clone https://gitee.com/laoyang103/ModSecurity && \
14+
cd ModSecurity && \
15+
git submodule init && \
16+
git submodule update && \
17+
./build.sh && \
18+
./configure
19+
20+
COPY include/global_define.h /ms/ModSecurity/src
21+
COPY src/rule_message.cc /ms/ModSecurity/src
22+
23+
RUN cd /ms/ModSecurity && make install || rm -rf /ms/ModSecurity
24+
25+
COPY . /uniwaf
26+
27+
RUN cd /uniwaf && mkdir lib obj bin && make && make install
28+
29+
FROM registry.jxit.net.cn:5000/alpine:3.19.1
30+
31+
RUN apk update && \
32+
apk add --no-cache tcpdump geoip vim curl libxml2 pcre zlib libstdc++ yajl libmaxminddb tzdata && \
33+
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
34+
echo "Asia/Shanghai" > /etc/timezone
35+
36+
COPY --from=builder /usr/local/modsecurity/lib/libmodsecurity.so /usr/local/lib/libmodsecurity.so.3
37+
38+
COPY --from=builder /uniwaf/lib/libmsutil.so /usr/local/lib
39+
40+
COPY --from=builder /uniwaf/bin/uniwaf /usr/local/bin
41+
42+
COPY modsecurity/ /usr/local/openresty/nginx/conf/modsecurity

mkimage.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
repo=registry.jxit.net.cn:5000/microflow/mfa
4+
5+
ver=$(git log --oneline . | wc -l)
6+
7+
docker build . -t $repo:git-$ver
8+
9+
docker push $repo:git-$ver

0 commit comments

Comments
 (0)