Docker-compose.yml issue

Description of your problem

docker-compose.yml provided in the Docker - Installing Graylog does not work when used with docker-compose up.
ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in “./docker-compose.yml”, line 5, column 23

I copied the yml file provided in sample. please let me know how to resolve this

Description of steps you’ve taken to attempt to solve the issue

Environmental information

Operating system information

  • Ubuntu

Package versions

  • Graylog-4.2
  • MongoDB-4.2
  • Elasticsearch-7.10.2

It looks like there have been a LOT of spaces mistakenly added in the port from our old docs site to the new docs site. You can try this version:

version: '3'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongo:
    image: mongo:4
    container_name: mongodb
    networks:
      - graylog
    ports:
      - 27017:27017
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
    container_name: elasticsearch
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks:
      - graylog
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:4.2
    container_name: graylog
    environment:
      - GRAYLOG_PASSWORD_SECRET=<YOURSECRET>
      - GRAYLOG_ROOT_PASSWORD_SHA2=<YOURSHA2>
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
      - GRAYLOG_ELASTICSEARCH_VERSION=7
      - GRAYLOG_HTTP_ENABLE_CORS=true
    networks:
      - graylog
    depends_on:
      - mongo
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - 9000:9000
      # Syslog TCP
      - 1514:1514
      # Syslog UDP
      - 1514:1514/udp
      # GELF TCP
      - 12201:12201
      # GELF UDP
      - 12201:12201/udp
      # Prometheus
      - 9091:9091
networks:
  graylog:
    driver: bridge

I’ve raised this with our technical writing team to have them address it.

1 Like

thanks a ton for the timely help. It worked.

can you also please let me know where to find the graylog conf file? it is not present in /etc/

infact there is no graylog dir…but graylog is up and running

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.