Docker Community Forums

Share and learn in the Docker community.

Grafana exited with code 1 error

Hello everyone. I have the following docker compose file:

version: '3'
services:

  # Define an InfluxDB service
  influxdb:
    image: influxdb:latest
    restart: always
    volumes:
      - /home/devops/influxdb/data:/var/lib/influxdb
      - /home/devops/influxdb/config:/etc/influxdb/
    ports:
      - "8086:8086"
      - "8082:8082"
      - "8089:8089"

  grafana:
      image: grafana/grafana:latest
      container_name: grafana
      ports:
        - "3000:3000"
      links:
        - influxdb
      volumes:
        - /home/devops/grafana/data:/var/lib/grafana
        - /home/devops/grafana/config:/etc/grafana

 # Define a Kapacitor service
  kapacitor:
    image: kapacitor:latest
    restart: always
    environment:
      KAPACITOR_HOSTNAME: kapacitor
      KAPACITOR_INFLUXDB_0_URLS_0: http://influxdb:8086
    volumes:
      - /home/devops/kapacitor/data/:/var/lib/kapacitor/
      - /home/devops/kapacitor/config/:/etc/kapacitor/
    links:
      - influxdb
    ports:
      - "9092:9092"

However, when I run docker-compse up I get this error:

grafana exited with code 1

The other services are running but not Grafana. I am not sure what I am doing wrong.