Setting up docker based Grafana dev environment

I’m looking for a proper example of how to set up a local development environment using docker-compose with a volume mapped that allows the built files to be loaded by Grafana.

I’ve gotten to the point where the plugin is recognized by Grafana but when you try to load it in a panel, I get 404 errors that the plugin files like module.js don’t exist.

This happens even with the templated project from @grafana/toolkit@^8

docker-compose.dev.yml

version: '3.7'
services:
  grafana:
    image: 'grafana/grafana:8.0.4'
    container_name: 'grafana_dev'
    ports:
      - '3000:3000'
#    volumes:
#      - './dist:/var/lib/grafana/plugins/ccf-mapview-panel'
    volumes:
      - '../:/var/lib/grafana/plugins'
    environment:
      GF_LOG_LEVEL: 'debug'
      GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: 'ccf-mapview-panel'

log

t=2021-07-02T15:48:39+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/public/plugins/ccf-mapview-panel/module.js status=404 remote_addr=172.19.0.1 time_ms=26 size=1727 referer="http://grafana.staged-by-discourse.com/dashboard/new?utm_source=grafana_gettingstarted&orgId=1&editPanel=2"
t=2021-07-02T15:48:39+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/public/plugins/ccf-mapview-panel/img/logo.svg status=404 remote_addr=172.19.0.1 time_ms=7 size=1727 referer="http://grafana.staged-by-discourse.com/dashboard/new?utm_source=grafana_gettingstarted&orgId=1&editPanel=2"

Hi @jdejesus

I ran through our “How To Build a Panel Plugin” tutorial the other day and it worked using Docker. Here was the command I used:

docker run -p 3000:3000 -v "$(pwd)"/my-plugin:/var/lib/grafana/plugins --name=grafana -e GF_DEFAULT_APP_MODE=development -e GF_LOG_LEVEL=debug grafana/grafana:8.0.5

I would check out the tutorial and see if a command like that works, adjusting the directory name as needed. my-plugin is my plugin root directory so I’m running the command from its parent directory.

Let me know if this doesn’t get you unblocked :+1:

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