initial commit
This commit is contained in:
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
ARG IPTABLES_MODE=nft
|
||||
|
||||
FROM ubuntu:noble AS iptables
|
||||
RUN --mount=type=cache,target=/var/lib/apt/lists,sharing=locked --mount=type=cache,target=/var/cache/apt,sharing=locked <<EOF
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install iptables -y
|
||||
EOF
|
||||
|
||||
FROM iptables AS iptables-legacy
|
||||
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy
|
||||
|
||||
FROM iptables AS iptables-nft
|
||||
RUN update-alternatives --set iptables /usr/sbin/iptables-nft
|
||||
|
||||
FROM golang:1.21.4 AS build-stage
|
||||
WORKDIR /app
|
||||
RUN git clone --depth 1 https://github.com/crowdsecurity/cs-custom-bouncer.git
|
||||
WORKDIR /app/cs-custom-bouncer
|
||||
RUN CGO_ENABLED=0 GOOS=linux make release
|
||||
|
||||
FROM iptables-${IPTABLES_MODE} AS crowdsec-custom-bouncer
|
||||
ARG IPTABLES_MODE=nft
|
||||
RUN mkdir -p /etc/crowdsec/bouncers
|
||||
COPY --from=build-stage /app/cs-custom-bouncer/crowdsec-custom-bouncer \
|
||||
/usr/bin/crowdsec-custom-bouncer
|
||||
COPY --from=build-stage /app/cs-custom-bouncer/config/crowdsec-custom-bouncer.yaml \
|
||||
/crowdsec-custom-bouncer.yaml
|
||||
ADD --chmod=770 bouncer.sh /bouncer.sh
|
||||
#prometheus port
|
||||
LABEL me.ar2000.gitea.buildargs.iptablesmode="${IPTABLES_MODE}"
|
||||
CMD ["/usr/bin/crowdsec-custom-bouncer", "-c", "/crowdsec-custom-bouncer.yaml"]
|
Reference in New Issue
Block a user