diff --git a/Dockerfile b/Dockerfile index e25e9c728..33f22b6c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,7 @@ COPY . . RUN SYSTEM="docker" make release RUN cd crowdsec-v* && ./wizard.sh --docker-mode && cd - -RUN cscli hub update && cscli collections install crowdsecurity/linux - +RUN cscli hub update && cscli collections install crowdsecurity/linux && cscli parsers install crowdsecurity/whitelists FROM alpine:latest 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 COPY --from=build /etc/crowdsec /etc/crowdsec diff --git a/docker/docker_start.sh b/docker/docker_start.sh index b9e890439..d45976040 100644 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -4,8 +4,8 @@ if [ "$DISABLE_AGENT" == "" ] ; then echo "Check if the container has already been started (ignore if agent is disabled)" cscli machines list | grep localhost - if [ $? == 1 ]; then - cscli lapi register --machine localhost + if [ "$?" == 1 ]; then + cscli machines add localhost --auto fi if [ "$AGENT_USERNAME" != "" ] && [ "$AGENT_PASSWORD" != "" ] && [ "$LOCAL_API_URL" != "" ] ; then echo "set up lapi credentials for agent" @@ -46,6 +46,7 @@ fi ## Install collections, parsers & scenarios cscli hub update cscli collections upgrade crowdsecurity/linux || true +cscli parsers upgrade crowdsecurity/whitelists || true if [ "$COLLECTIONS" != "" ]; then cscli collections install $COLLECTIONS fi