Issues with running on Docker

Hey guys,

I’m trying to get Crowdsec on Docker, but I’m running into some issues.

OS: Ubuntu 20.04
Docker compose
Crowdsec later image
Traefik

  crowdsec:
    image: crowdsecurity/crowdsec:latest
    container_name: Crowdsec
    environment:
      GID: "GID=997" # Also tried GID=1000 and ${GID-1000}
      TZ: "$TZ"
      # CONFIG_FILE: "/etc/crowdsec/config.yaml"
      COLLECTIONS: "crowdsecurity/linux crowdsecurity/traefik"
    depends_on:  #uncomment if running traefik in the same compose file
      - 'traefik'
    volumes:
      - $USERDIR/Crowdsec/config/acquis.yaml:/etc/crowdsec/acquis.yaml
      - $USERDIR/Crowdsec/config/config.yaml:/etc/crowdsec/config.yaml
      - $USERDIR/Crowdsec/db:/var/lib/crowdsec/data/
      - $USERDIR/Crowdsec/config:/etc/crowdsec/
      - $USERDIR/Traefik:/var/log/traefik/:ro
    networks:
      pihole:
        ipv4_address: '172.22.0.138'
    restart: always

My log files are:

* today at 00:04:51time="18-02-2022 12:04:51 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:51time="18-02-2022 12:04:51 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:51time="18-02-2022 12:04:51 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:51time="2022-02-18T00:04:51Z" level=fatal msg="no configuration paths provided"
* today at 00:04:51time="2022-02-18T00:04:51Z" level=fatal msg="no configuration paths provided"
* today at 00:04:52Regenerate local agent credentials
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52Check if lapi need to register automatically an agent
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="18-02-2022 12:04:52 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="2022-02-18T00:04:52Z" level=fatal msg="no configuration paths provided"
* today at 00:04:52time="2022-02-18T00:04:52Z" level=fatal msg="no configuration paths provided"
* today at 00:04:53Regenerate local agent credentials
* today at 00:04:53time="18-02-2022 12:04:53 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:53time="18-02-2022 12:04:53 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:53Check if lapi need to register automatically an agent
* today at 00:04:53time="18-02-2022 12:04:53 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:53time="18-02-2022 12:04:53 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:54time="18-02-2022 12:04:54 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:54time="18-02-2022 12:04:54 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:54time="18-02-2022 12:04:54 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:54time="2022-02-18T00:04:54Z" level=fatal msg="no configuration paths provided"
* today at 00:04:54time="2022-02-18T00:04:54Z" level=fatal msg="no configuration paths provided"
* today at 00:04:56Regenerate local agent credentials
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56Check if lapi need to register automatically an agent
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="18-02-2022 12:04:56 AM" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="2022-02-18T00:04:56Z" level=fatal msg="no configuration paths provided"
* today at 00:04:56time="2022-02-18T00:04:56Z" level=fatal msg="no configuration paths provided"
* today at 00:05:00Regenerate local agent credentials
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00Check if lapi need to register automatically an agent
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="18-02-2022 12:05:00 AM" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="2022-02-18T00:05:00Z" level=fatal msg="no configuration paths provided"
* today at 00:05:00time="2022-02-18T00:05:00Z" level=fatal msg="no configuration paths provided"
* today at 00:05:01Container stopped

Not quite sure where I’m going wrong here. I don’t really want to create a docker volume as a bind mount should definitely suffice, and the “GID” env var isn’t mentioned anywhere in your documentation (I’ve tried several different ways of writing it including the value in your github repo, but no change).

When the container starts up, it’s happy enough to write it’s own config and acquis file, but for some reason it seems to be stuck with not accessing it.

Hi

A couple of comments. First of all, it seems like the Docker container does not like bind volumes. I believe a community member has submitted a PR but not sure it has been merged.

Secondly there’s a lot of talk on Docker in the designated Discord channel. That it really the place to go for quick help by the community. The invite link should be in a message on the top of every page in Discourse (unless you dismissed it). If you have the chance, you should really join.

Thirdly, the Docker container doesn’t support seeting GUID via environment variables. No idea why. You can find the available documentation on how to use it at Docker Hub.

Fourthly you should check out this article written by a community member. It should help solve your problem: Integrating CrowdSec with Traefik & Discord. If not, the author is very active on Discord and usually helps out when questions are asked on Docker.

Have a great day!

1 Like