2021-06-11 09:50:05 +00:00
|
|
|
ARG GOVERSION=1.16
|
2020-11-30 09:37:17 +00:00
|
|
|
|
|
|
|
FROM golang:${GOVERSION}-alpine AS build
|
|
|
|
|
|
|
|
WORKDIR /go/src/crowdsec
|
|
|
|
|
2021-06-11 09:50:05 +00:00
|
|
|
RUN apk update && apk add --no-cache git jq gcc libc-dev make bash gettext binutils-gold
|
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 -
|
2020-11-30 09:37:17 +00:00
|
|
|
RUN cscli hub update && cscli collections install crowdsecurity/linux
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2021-06-11 09:50:05 +00:00
|
|
|
RUN apk update --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community && apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community tzdata yq
|
2020-11-30 09:37:17 +00:00
|
|
|
COPY --from=build /etc/crowdsec /etc/crowdsec
|
|
|
|
COPY --from=build /var/lib/crowdsec /var/lib/crowdsec
|
|
|
|
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 /
|
|
|
|
COPY --from=build /go/src/crowdsec/docker/config.yaml /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
|
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/http/http.yaml /etc/crowdsec/notifications/http.yaml
|
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/slack/slack.yaml /etc/crowdsec/notifications/slack.yaml
|
|
|
|
COPY --from=build /go/src/crowdsec/plugins/notifications/splunk/splunk.yaml /etc/crowdsec/notifications/splunk.yaml
|
|
|
|
COPY --from=build /usr/local/lib/crowdsec/plugins /usr/local/lib/crowdsec/plugins
|
2020-11-30 09:37:17 +00:00
|
|
|
|
|
|
|
ENTRYPOINT /bin/sh docker_start.sh
|