2021-12-16 13:39:58 +00:00
|
|
|
ARG GOVERSION=1.17
|
2020-11-30 09:37:17 +00:00
|
|
|
|
|
|
|
FROM golang:${GOVERSION}-alpine AS build
|
|
|
|
|
|
|
|
WORKDIR /go/src/crowdsec
|
|
|
|
|
2021-11-03 15:56:44 +00:00
|
|
|
# wizard.sh requires GNU coreutils
|
2021-12-14 09:58:22 +00:00
|
|
|
RUN apk add --no-cache git jq gcc libc-dev make bash gettext binutils-gold coreutils
|
2021-03-12 10:00:08 +00:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2021-04-23 13:23:46 +00:00
|
|
|
RUN SYSTEM="docker" make release
|
2021-09-09 14:05:21 +00:00
|
|
|
RUN cd crowdsec-v* && ./wizard.sh --docker-mode && cd -
|
2021-09-13 08:48:48 +00:00
|
|
|
RUN cscli hub update && cscli collections install crowdsecurity/linux && cscli parsers install crowdsecurity/whitelists
|
2020-11-30 09:37:17 +00:00
|
|
|
FROM alpine:latest
|
2022-04-04 08:18:44 +00:00
|
|
|
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community tzdata yq jq bash && \
|
2022-02-01 11:35:57 +00:00
|
|
|
mkdir -p /staging/etc/crowdsec && \
|
|
|
|
mkdir -p /staging/var/lib/crowdsec
|
|
|
|
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
|
|
|
|
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
|
2020-11-30 09:37:17 +00:00
|
|
|
COPY --from=build /usr/local/bin/crowdsec /usr/local/bin/crowdsec
|
|
|
|
COPY --from=build /usr/local/bin/cscli /usr/local/bin/cscli
|
|
|
|
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
|
2022-02-01 11:35:57 +00:00
|
|
|
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
|
2021-09-09 14:05:21 +00:00
|
|
|
#Due to the wizard using cp -n, we have to copy the config files directly from the source as -n does not exist in busybox cp
|
|
|
|
#The files are here for reference, as users will need to mount a new version to be actually able to use notifications
|
2022-02-28 11:04:31 +00:00
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/email/email.yaml /staging/etc/crowdsec/notifications/email.yaml
|
2022-02-01 11:35:57 +00:00
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/http/http.yaml /staging/etc/crowdsec/notifications/http.yaml
|
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/slack/slack.yaml /staging/etc/crowdsec/notifications/slack.yaml
|
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/splunk/splunk.yaml /staging/etc/crowdsec/notifications/splunk.yaml
|
2021-09-09 14:05:21 +00:00
|
|
|
COPY --from=build /usr/local/lib/crowdsec/plugins /usr/local/lib/crowdsec/plugins
|
2020-11-30 09:37:17 +00:00
|
|
|
|
2022-02-15 16:10:15 +00:00
|
|
|
ENTRYPOINT /bin/bash docker_start.sh
|