Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Docker image #95

Open
laurentgoudet opened this issue Nov 10, 2023 · 1 comment
Open

Provide a Docker image #95

laurentgoudet opened this issue Nov 10, 2023 · 1 comment

Comments

@laurentgoudet
Copy link

Most (all?) bouncers seem to be available as a Docker image, but not this one. Arguably depending on what the custom script is doing, a custom image will still need to be built (to install dependencies), but having an official image to extend would make the process easier.

In the meantime if anyone having the same issue, here's a sample Dockerfile that works for me (the custom script just needs to be mounted to the bin_path value in the YAML config):

ARG VERSION=v0.0.17-rc6

FROM golang:1.21.4 as build-stage
ARG VERSION
WORKDIR /app

RUN git clone --branch $VERSION --depth 1 https://github.com/crowdsecurity/cs-custom-bouncer.git
WORKDIR /app/cs-custom-bouncer
RUN CGO_ENABLED=0 GOOS=linux make release

FROM ubuntu:22.04
ARG VERSION
WORKDIR /

RUN mkdir -p /etc/crowdsec/bouncers
COPY --from=build-stage /app/cs-custom-bouncer/crowdsec-custom-bouncer-$VERSION/crowdsec-custom-bouncer \
    /usr/bin/crowdsec-custom-bouncer
COPY --from=build-stage /app/cs-custom-bouncer/crowdsec-custom-bouncer-$VERSION/config/crowdsec-custom-bouncer.yaml \
    /etc/crowdsec/bouncers/crowdsec-custom-bouncer.yaml

CMD ["/usr/bin/crowdsec-custom-bouncer", "-c", "/etc/crowdsec/bouncers/crowdsec-custom-bouncer.yaml"]

Alternatively just providing that sample Dockerfile in the docs would be nice

@yarafie
Copy link

yarafie commented Oct 31, 2024

@laurentgoudet how do I make use of this/
Any step by step instructions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants