이슈 해결

[Issue 해결] mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied GF_PATHS_DATA='/var/lib/grafana' is not writable.

영최 2024. 3. 28. 00:37
728x90

❗️ Issue 

mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied GF_PATHS_DATA='/var/lib/grafana' is not writable.

 

💡 Solution 

구글링을 하다 보니 권한 문제 인것 같아 volumes 아래 부분에 user: root 라는 문구를 적어줬더니 정상적으로 컨테이너가 실행되는것을 확인했다.


version: '3'
services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    user: root
    volumes:
      - /home/monitor/prometheus/:/etc/prometheus/
      - /home/monitor/prometheus/data:/prometheus
    ports:
      - 9090:9090
    restart: always

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
      - GF_USERS_ALLOW_SIGN_UP=false
    volumes:
      - /home/monitor/grafana:/var/lib/grafana
      - /home/monitor/grafana/provisioning:/etc/grafana/provisioning
    ports:
      - 3000:3000
    restart: always
    user: root
728x90