Coder Social home page Coder Social logo

grafana-docker's Introduction

The Grafana Docker image has moved

The build for the Grafana docker image has been moved into the main repository. This was done to simplify the build process and to tie a specific version of the docker image to a specific version of Grafana.

This means:

  • the open PR's and issues were closed and re-created in the main repo
  • any new issues should be created here
  • the build lives here, under packaging/docker

We'd like to thank everyone who has helped out in creating our Docker image and look forward to keep working with you in its new home.

grafana-docker's People

Contributors

altitude avatar bergquist avatar bobrik avatar corentingi avatar dancech avatar daniellee avatar edschouten avatar efrecon avatar jangaraj avatar jmaitrehenry avatar kjr-stratslab avatar kulinacs avatar marefr avatar marvambass avatar northisup avatar patricklucas avatar philipnrmn avatar pjenvey avatar puneeth-n avatar skozin avatar suquant avatar tail avatar tomwilkie avatar torkelo avatar tyranron avatar verdel avatar vsilverman avatar xlson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-docker's Issues

[Question] - MySQL storage instead of volume?

Could a MySQL server be used instead of the persistent disk storage / docker volume? This would make things a bit easier as we could run multiple databases and store all the data outside of the docker / docker host? Is that an option?

GF_INSTALL_PLUGINS Not working

Tried adding this as a an environment variable on my Grafana container with the example provided plugins "grafana-clock-panel,grafana-simple-json-datasource" and they are not installed. if i install them manually and restart the container they are there, but if the container gets upgrade/moved to a different host in the cluster the plugins are gone. I don't mind making plugins a persistent storage location if need be, but shouldn't the GF_INSTALL_PLUGINS env be working?

Thanks

GF_SECURITY_ADMIN_PASSWORD does not work but gets recognized

I have

GF_SECURITY_ADMIN_PASSWORD="1199"

as my ENV var. In the log it says msg="Config overriden from Environment variable" logger=settings var="GF_SECURITY_ADMIN_PASSWORD=*********" but if i want to login with admin/1199 it does fail.

Log says:

lvl=eror msg="Invalid username or password" logger=context userId=0 orgId=0 uname= error="Invalid Username or Password"

Frequent dashboard timeouts with Grafana docker container

We are seeing frequent timeouts with our Grafana dashboards on refresh. The behavior is a blank graph with loading icon for many graphs.

We are using multiple Graphite datasources. Making requests to those datasources alone (via curl or Dev HTTP Client Chrome Plugin) work fine and are fast. However, when I try making the same HTTP requests through the Grafana Proxy URL (/api/datasources/proxy/NN) I see frequent timeouts and 500 errors.

When watching Grafana logs I see this message repeatedly:

[...SNIP...]
2015/08/17 20:51:13 http: proxy error: dial tcp: i/o timeout
2015/08/17 20:51:13 [I] Completed /render 500 Internal Server Error in 30.029153877s
2015/08/17 20:51:22 http: proxy error: dial tcp: i/o timeout
2015/08/17 20:51:22 [I] Completed /render 500 Internal Server Error in 30.028727s
[...SNIP...]

When I tried bypassing Grafana entirely and just running requests via curl on the host machine, and inside the docker container I saw slowness only inside the docker container!

$ cat /tmp/curl-format.txt

time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n

Inside Docker Container:

$ sudo docker exec -ti grafana-container  time curl -w "@/tmp/curl-format.txt" -v -s 'http://graphite.example.com/render/?width=586&height=308&from=-4hours&format=json&maxDataPoints=638&target=alias(test.kafka.offsets.TestKafkaOffset.Test.total%2C%20%27Objects%27)'
       time_connect:  35.097
    time_appconnect:  0.000
   time_pretransfer:  35.097
      time_redirect:  0.000
 time_starttransfer:  35.158
                    ----------
         time_total:  35.159

real    0m35.172s
user    0m0.008s
sys     0m0.010s

Outside Docker Container (on same Host):

$ time curl -w "@/tmp/curl-format.txt" -v -s 'http://graphite.example.com/render/?width=586&height=308&from=-4hours&format=json&maxDataPoints=638&target=alias(test.kafka.offsets.TestKafkaOffset.Test.total%2C%20%27Objects%27)'
       time_connect:  0.200
    time_appconnect:  0.000
   time_pretransfer:  0.200
      time_redirect:  0.000
 time_starttransfer:  0.263
                    ----------
         time_total:  0.264

real    0m0.273s
user    0m0.004s
sys     0m0.007s

I think this may have something to do with a broken network configuration inside the debian:wheezy container that this image is based on. Running a simple apt-get update inside the container results in many network connect errors due to IPv6:

$ sudo docker exec -ti grafana-container apt-get update
Err http://security.debian.org wheezy/updates Release.gpg
  Cannot initiate the connection to security.debian.org:80 (2610:148:1f10:3::73). - connect (101: Network is unreachable) [IP: 2610:148:1f10:3::73 80]
Ign http://security.debian.org wheezy/updates Release
Err http://security.debian.org wheezy/updates/main amd64 Packages
Err http://security.debian.org wheezy/updates/main amd64 Packages
Err http://security.debian.org wheezy/updates/main amd64 Packages
Err http://security.debian.org wheezy/updates/main amd64 Packages
Err http://security.debian.org wheezy/updates/main amd64 Packages
  Cannot initiate the connection to security.debian.org:80 (2610:148:1f10:3::73). - connect (101: Network is unreachable) [IP: 2610:148:1f10:3::73 80]

For what it's worth, it appears grafana-server inside the docker container has grabbed the IPv6 loopback address rather than IPv4:

root@www-grafana:/usr/share/grafana# cat /etc/debian_version
7.8
root@www-grafana:/usr/share/grafana# uname -a
Linux www-efp-grafana-hnswh 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64 GNU/Linux
root@www-grafana:/usr/share/grafana# netstat -tunlp |grep p6
tcp6       0      0 :::3000                 :::*                    LISTEN      1/grafana-server

Unable to run grafana container with SELinux enabled due to gosu 1.5 bug

Attempting to run the grafana image using:

docker run -d --name=grafana -p 3000:3000 grafana/grafana

fails with the following error message when SELinux is enabled:

error: failed switching to "grafana": fchown fds permission denied

This appears to be due to a bug in gosu 1.5 (see discussion at docker-library/mongo#56 and tianon/gosu#8;) which has since been fixed. I've tested rebuilding the image with gosu versions 1.6 and 1.7 and both resolve the issue.

I've also noticed that using the -t option to the docker run command to create a pseudo-tty will workaround the issue as well.

Crashing immediately

Had previous grafana version (unknown, but ran into the too many redirects bug, so reinstalled).

Installed latest. Running the image immediately fails. I hooked in and grabbed the output.

# ./run.sh
INFO[02-08|23:10:46] Starting Grafana                         logger=main version=4.1.1 commit=v4.1.1 compiled=2017-01-12T08:48:03+0000
INFO[02-08|23:10:46] Config loaded from                       logger=settings file=/usr/share/grafana/conf/defaults.ini
INFO[02-08|23:10:46] Config loaded from                       logger=settings file=/etc/grafana/grafana.ini
INFO[02-08|23:10:46] Config overriden from command line       logger=settings arg="default.paths.data=/var/lib/grafana"
INFO[02-08|23:10:46] Config overriden from command line       logger=settings arg="default.paths.logs=/var/log/grafana"
INFO[02-08|23:10:46] Config overriden from command line       logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
INFO[02-08|23:10:46] Path Home                                logger=settings path=/usr/share/grafana
INFO[02-08|23:10:46] Path Data                                logger=settings path=/var/lib/grafana
INFO[02-08|23:10:46] Path Logs                                logger=settings path=/var/log/grafana
INFO[02-08|23:10:46] Path Plugins                             logger=settings path=/var/lib/grafana/plugins
INFO[02-08|23:10:46] Initializing DB                          logger=sqlstore dbtype=sqlite3
INFO[02-08|23:10:46] Starting DB migration                    logger=migrator
INFO[02-08|23:10:46] Executing migration                      logger=migrator id="create migration_log table"
EROR[02-08|23:10:46] Executing migration failed               logger=migrator id="create migration_log table" error="database or disk is full"
EROR[02-08|23:10:46] Exec failed                              logger=migrator error="database or disk is full" sql="CREATE TABLE IF NOT EXISTS `migration_log` (\n`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\n, `migration_id` TEXT NOT NULL\n, `sql` TEXT NOT NULL\n, `success` INTEGER NOT NULL\n, `error` TEXT NOT NULL\n, `timestamp` DATETIME NOT NULL\n);"
EROR[02-08|23:10:46] Fail to initialize orm engine            logger=sqlstore error="Sqlstore::Migration failed err: database or disk is full\n"
# df
Filesystem     1K-blocks     Used Available Use% Mounted on
overlay         65792556 62431488         0 100% /
tmpfs            2021084        0   2021084   0% /dev
tmpfs            2021084        0   2021084   0% /sys/fs/cgroup
/dev/sda1       65792556 62431488         0 100% /etc/hosts
shm                65536        0     65536   0% /dev/shm
tmpfs            2021084        0   2021084   0% /sys/firmware
# 

Running latest docker beta 1.13.1-rc2-beta41 (15300)

GF_SECURITY_ADMIN_PASSWORD issue

I am trying to change the admin password with
-e "GF_SECURITY_ADMIN_PASSWORD=xxx", but it seems like admin password is still "admin"

Unable to start Grafana when using custom paths

To reproduce, run this:

docker run --rm -it --name=grafana \
  -p 3000:3000 \
  -v /data \
  -e GF_PATHS_DATA=/data \
  grafana/grafana:latest

It will fail with the following output:

2016/02/17 23:34:07 [I] Starting Grafana
2016/02/17 23:34:07 [I] Version: 2.6.0, Commit: v2.6.0, Build date: 2015-12-14 14:18:01 +0000 UTC
2016/02/17 23:34:07 [I] Configuration Info
Config files:
  [0]: /usr/share/grafana/conf/defaults.ini
  [1]: /etc/grafana/grafana.ini
Command lines overrides:
  [0]: default.paths.data=/var/lib/grafana
  [1]: default.paths.logs=/var/log/grafana
    Environment variables used:
  [0]: GF_PATHS_DATA=/data
Paths:
  home: /usr/share/grafana
  data: /data
  logs: /var/log/grafana

2016/02/17 23:34:07 [I] Database: sqlite3
2016/02/17 23:34:07 [I] Migrator: Starting DB migration
2016/02/17 23:34:07 [log.go:75 Fatal()] [E] fail to initialize orm engine: Sqlstore::Migration failed err: unable to open database file

This is caused by #19, as it assumes that Grafana uses default paths: /var/lib/grafana for data and /var/log/grafana for logs. As a result, Grafana is unable to write to non-standard GF_PATHS_DATA and GF_PATHS_LOGS directories, because they are still owned by root.

Chrome : Data Source not working

Hello,

I tried to use your container (working with another graphite container.)

When I try to add a new data source with Chrome, I have many errors (see screenshot):

image

If I do exactly the same on Internet Explorer, everything is working well, I can add a data source and create some dashboards

image

So I created all my dashboards, they are all working well. But if I try to check them with Google Chrome, I have an empty dashboard (always loading).

Dashboard from IE :

image

Dashboard from Chrome

image

If I check the Google Chrome console :

image

Do you know how to fix it ?

Thank you.

dpkg-deb: error

I'm getting below error while building grafana image on docker toolbox

dpkg-deb: error: `/tmp/grafana.deb' is not a debian format archive
dpkg: error processing archive /tmp/grafana.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /tmp/grafana.deb

below is Dockerfile

FROM debian:jessie

ARG GRAFANA_VERSION

RUN apt-get update && \
    apt-get -y --no-install-recommends install libfontconfig curl ca-certificates && \
    apt-get clean && \
    curl https://grafanarel.s3.amazonaws.com/builds/grafana_${GRAFANA_VERSION}_amd64.deb > /tmp/grafana.deb && \
    dpkg -i /tmp/grafana.deb && \
    rm /tmp/grafana.deb && \
    curl -L https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64 > /usr/sbin/gosu && \
    chmod +x /usr/sbin/gosu && \
    apt-get remove -y curl && \
    apt-get autoremove -y && \
    rm -rf /var/lib/apt/lists/*

VOLUME ["/var/lib/grafana", "/var/log/grafana", "/etc/grafana"]

EXPOSE 3000

COPY ./run.sh /run.sh

ENTRYPOINT ["/run.sh"]

any clue?

Wrong data/log dir?

Hi,

I noticed that we have data and log stuff in /usr/share/grafana/data instead of /var/lib/grafana and /var/log/grafana.
Is this on purpose or wrong directory path ?

Drag and Drop Bug

When creating many panels and rows I'm consistently running into a bug where dragging a panel to a position makes the panel appear elsewhere within the grid and spits out the following js error:

Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: (name, panel) in row.panels track by panel.id, Duplicate key: 64, Duplicate value: {"cacheTimeout":null,"colorBackground":true,"colorValue":false,"colors":["rgba(225, 31, 31, 0.9)","rgba(237, 129, 40, 0)","rgba(103, 115, 103, 0)"],"datasource":"InfluxDB","decimals":0,"editable":true,"error":false,"format":"none","height":"","id":64,"interval":null,"links":[],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"30%","prefix":"","prefixFontSize":"100%","span":4,"sparkline":{"fillColor":"rgba(0, 148, 255, 0)","full":false,"lineColor":"rgba(29, 174, 0, 0)","show":false},"targets":[{"fields":[{"func":"mean","name":"value"}],"groupByTags":[],"measurement":"jobs_completed","query":"SELECT last(value) FROM jobs_remaining WHERE modelName='Keyword' AND taskName='BingRanker' ORDER BY asc","rawQuery":true,"tags":{"modelName":"Backlink","taskName":"Crawler"}}],"thresholds":"-999999999,0,0","timeFrom":null,"title":"Remaining","transparent":false,"type":"singlestat","valueFontSize":"70%","valueMaps":[{"op":"=","text":"-","value":"null"}],"valueName":"current"}
http://errors.angularjs.org/1.4.3/ngRepeat/dupes?p0=(name%2C%20panel)%20in%…-%22%2C%22value%22%3A%22null%22%7D%5D%2C%22valueName%22%3A%22current%22%7D
at app.bd986dd5.js:9
at app.bd986dd5.js:14
at Object.d as fn
at n.$digest (app.bd986dd5.js:12)
at app.bd986dd5.js:12
at e (app.bd986dd5.js:9)
at app.bd986dd5.js:9

Updated to 2.0 release?

Is there any chance this Docker image will be updated for Grafana 2.0 release?

(I'm on OSX, and there are no OSX binaries, or even a Homebrew recipe - hence, this Docker image seems like the easiest way to get it up and running).

exec format error

I am having this error :

 sudo docker run -i -p 3000:3000 \
  -e "GF_SERVER_ROOT_URL=http://localhost"  \
  -e "GF_SECURITY_ADMIN_PASSWORD=secret"  \
  grafana/grafana
Unable to find image 'grafana/grafana:latest' locally
latest: Pulling from grafana/grafana
77e39ee82117: Pull complete 
5eb1402f0414: Pull complete 
191f90a2af67: Pull complete 
d8a8a3516920: Pull complete 
fb17ad5ffa98: Pull complete 
19383035052e: Pull complete 
227a6571d6bc: Pull complete 
83005a21bef3: Pull complete 
Digest: sha256:5470c683ceb87debb4c89460e275ee3e5096f86e6d605bc54729c993c70f04d8
Status: Downloaded newer image for grafana/grafana:latest
exec format error
FATA[0165] Error response from daemon: Cannot start container 24513eba47dda4b88fa02746fd5bb7da399a2301f875f6b9185262958d163f2d: [8] System error: exec format error 

My docker version

$ docker -v                                                                                                                                                                                     Docker version 1.6.2, build 7c8fca2

Running on

$ uname -a                                                                                                                                                                                      Linux ubuntu 3.19.0-25-generic #26-Ubuntu SMP Fri Jul 24 21:16:27 UTC 2015 i686 i686 i686 GNU/Linux

Anything that I missed?

Remove VOLUME declaration from Dockerfile (or propose method for changing config on a remote docker host)

If I use grafana-docker on a remote docker host (e.g., via docker-machine), as far as I can tell, I cannot change the grafana config files/directories without uploading those files to the remote docker host first (since volume declarations are with regards to the remote host).

With other docker images (e.g., the official nginx image), I can create a Dockerfile that extends the official image, and then use COPY commands to change the config files I want.

When I try this custom Dockerfile with grafana (i.e., that starts with FROM grafana/grafana:latest), my commands that change the grafana config directories have no effect. From what I understand, this is because the volumes are initialized after the Dockerfile is processed, so any changes done to the locations is overwritten when the volumes are mounted.

Example of what I'm trying to do:

FROM grafana/grafana:latest

# copy grafana.ini file that enables dashboards.json setting:
COPY grafana.ini /etc/grafana/
RUN mkdir -p //var/lib/grafana/dashboards
COPY dashboards/ /var/lib/grafana/dashboards/

I'm assuming that the VOLUME command is used to prevent losing of any config changes done via the grafana web UI, but I suspect that there are only a handful of files/directories that are changed by the grafana web UI (e.g. the sql database).

I propose we remove many of the volumes from the grafana Dockerfile so that my above use-case can be accomplished. At the very least, have /etc/grafana not in there so that grafana.ini can be overwritten. THen, for the files that are changed regularly via the grafana web UI (e.g., grafana's sqlite db), continue to have a volume for these (or move the files to a new directory that doesn't conflict with grafana's config directories and make that a docker volume).

Thoughts?

No LICENSE.md in project

Would it be possible to make this project explicitly open source? Maybe add the same license as the Grafana project.

To elaborate a bit more. GitHub terms explicitly permit viewing and forking of public projects, they do not enforce an open source license to the project, this means that normal copyright otherwise applies. I can't do anything with the project besides viewing and forking if a license is absent.

Grafana 4.2

Hii,
I want to use grafana 4.2 docker image... how can i get that?

Installing plugins

Following the instructions on the README I use the following to start Grafana instance:

sudo docker run -d -i -p 3000:3000 -e "GF_AUTH_BASIC_ENABLED=false" \
     -e "GF_AUTH_ANONYMOUS_ENABLED=true" \
     -e "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin" \
     -e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource" \
     grafana/grafana:3.0.4

Grafana do runs, but its look like the plugin are not loaded.
Any advice?

Create alpine based container

Alpine linux seems to be the direction of the docker community with respect to reducing image size.
It might be nice to have a grafana/grafana:alpine tag, like most official repos have.

Rebuild image for 2.6.0 in docker hub to fix CVE-2015-7547

The Image for 2.6.0 in the docker hub is currently shipping an older version of debian jessie, which contains a glibc version vulnerable to CVE-2015-7547. This issue entails denial of service and/or arbitrary code execution via crafted DNS packages. The current debian jessie image contains a fixed version, so simply rebuilding 2.6.0 without any further changes (apart from pulling a fresh debian:jessie) should remedy this issue.

This has also been raised by user xbglowx on the docker hub.

v2.5.0

Hi, is there a time plan when the Dockerfile gets upgraded to version 2.5.0?

Incorrect use of functions

Hi! Sending a lot of test metrics, e.g: test 1.000000 1484148820 i want to represent the count of the hits.

When trying: hitcount(test, '20s') only represents a horizontal line and also the same result using: summarize(test, '20s').

What will be the correct way to make work this example?

Thanks in advance!

Allow grafana to be run as root

Is there a really good reason to not run Grafana as root within Docker? I'm using a plugin which gives each container it's own IP address (Weave) and I'd like to just have Grafana listen on :80, but the created Grafana user doesn't have permission to do so.

error: failed switching to "grafana": fchown fds permission denied

When I do a docker run:

docker run \
  -d \
  -p 3000:3000 \
  --name=grafana \
  --volumes-from grafana-storage \
  grafana/grafana:2.6.0

I get the error:
error: failed switching to "grafana": fchown fds permission denied
I get this error for both latest and 2.6.0 but if I use develop It works.
Any ideas whats with this?

Doesn't bind

$ docker run --rm --name=grafana -it grafana/grafana -p 3000:3000
$ docker-machine ssh
docker@default:~$ sudo netstat -napt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1276/sshd
tcp        0     36 10.0.2.15:22            10.0.2.2:57719          ESTABLISHED 5592/sshd: docker [
tcp        0      0 :::22                   :::*                    LISTEN      1276/sshd
tcp        0      0 :::2376                 :::*                    LISTEN      27921/dockerd
tcp        0      0 ::ffff:192.168.99.100:2376 ::ffff:192.168.99.1:57665 ESTABLISHED 27921/dockerd
tcp        0      0 ::ffff:192.168.99.100:2376 ::ffff:192.168.99.1:57664 ESTABLISHED 27921/dockerd
docker@default:~$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
885d4b467d29        grafana/grafana     "/run.sh -p 3000:3000"   2 minutes ago       Up 2 minutes        3000/tcp            grafana

unable to save dashboard using external directory

I'm trying to attach an external directory to the grafana image.

All my attempt to make the dashboard files writable have failed.

The json files located under grafana/dashboards locally

I first tried:
sudo docker run -d -v $PWD/grafana/dashboards:/var/lib/grafana/dashboards:Z -i -p 3000:3000
-e "GF_AUTH_BASIC_ENABLED=false"
-e "GF_AUTH_ANONYMOUS_ENABLED=true"
-e "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin"
-e "GF_INSTALL_PLUGINS=grafana-piechart-panel"
-e "GF_DASHBOARDS_JSON_ENABLED=TRUE"
-e "GF_DASHBOARDS_JSON_PATH=/var/lib/grafana/dashboards"
--name agraf grafana/grafana:3.1.0

Becuase of the chown command running in the container, I both loose ownership of my local json files and the files are not writeable (no save button).

I also tried placing the files not under /var/lib/grafana (/var/lib/grafana1).

In that case, I do not loose the ownership, it seems that the grafana user inside the container do have the right permissions but still no save button.

Publish v4.1.2

Hi,

I could not find the version 4.1.2 in the hub. Could you push it please?

Thanks

Fail to start/build grafana/grafana

Hi!
I'm having trouble with grafana and docker:
# docker run -i -p 3000:3000 grafana/grafana ... docker: Error response from daemon: Container command '/run.sh' not found or does not exist..
So I cloned this repo and tried to build the image by my self:
~/grafana-docker# ./build.sh ... Container command '/bin/sh' not found or does not exist.
I tried to setup a link in the Dockfile between /bin/bash and /bin/sh without success.
Have anyone a clue how to solve this?

Plugin versions not working

The plugin version seems to be broken again. #59 #60

docker image 4.1.1

My docker-compose config:

grafana:
    container_name: grafana
    image: grafana/grafana:latest
    environment:
        - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-piechart-panel,grafana-worldmap-panel,stagemonitor-elasticsearch-app,grafana-simple-json-datasource  1.2.3
        - GF_GRAFANA_NET=https://grafana.net
        - GF_LOG_MODE=console
        - GF_LOG_LEVEL=info
        - GF_LOG_CONSOLE_LEVEL=info
        - GF_USERS_ALLOW_SIGN_UP=false
        - GF_USERS_ALLOW_ORG_CREATE=false

DNS failure due to /etc/hosts and /etc/resolv.conf permissions

Hi there,

Im using Grafana 4.1.1 (grafana/grafana:latest) and I found that certain webhook endpoints do not work from within the Docker container. The do work from outside of the container though if I were to query them using CURL or a browser.

The error log notes DNS lookup failures, and this appears to be because the grafana user running grafana-server in the container does not have read permissions on /etc/hosts and /etc/resolv.conf.

When I add read permissions (chmod 644) to /etc/hosts and /etc/resolv.conf then the webhooks work.

I notice the run.sh already does a chown on certain folders. Does it make sense to add the following to the run.sh script?

chmod 644 /etc/hosts
chmod 644 /etc/resolve.conf

Paul.

Support env flags for setting PID / GID

On some systems (Synology) this image will run into permissions problems (if you don't 777 your docker volume directory) because the PID / GID is set wrong. It would be great if these two env variables would be supported. This would solve issues like that one without some hacky 777 workaround: #32

Example how other containers do it:

https://github.com/linuxserver/docker-rutorrent#user--group-identifiers

Sometimes when using data volumes (-v flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.

That's how other images implement it:

https://github.com/cpoppema/docker-flexget/blob/master/init/90_new_user.sh

Thanks

[Feature request] Add dashboard import by environment variable

One important feature in containers is the automation of initial configuration. In the grafana docker image this possibility is missing.

One container that runs this image is not useful without an initial manual configuration. This wouldn't be a problem if we don't count with the volatility of containers.

Adding the option of automatically import dashboards by environment variables would be a huge improvement.

For example:

docker run \
  --name grafana \
  -e GF_INSTALL_DASHBOARDS=123,456 \
  grafana/grafana

Which would import the dashboards available in grafana.net with these ids. If when they are imported the references to the datasources already exist in the container it would use them directly. If not, the first time, it should show the option of which datasources to use.

SSL certificates not loaded

When using Google Auth in this docker image, it will throw an exception:

[login_oauth.go:40 OAuthLogin()] [E] login.OAuthLogin(NewTransportWithCode): Post https://accounts.google.com/o/oauth2/token: x509: failed to load system roots and no roots provided

That's because no SSL certificates are present in the image.

As a work-around you can add the certs from your host system

-v /etc/ssl/certs:/etc/ssl/certs

Plugins Version

I am trying to specify the version of the plugins in my docker-compose.yml. I have tried to put it as as specified in grafana plugins docs but it has been impossible to install the required version. I think it could be fixed of the way that GF_INSTALL_PLUGINS is read, making possible to read the var with values like the next example:

GF_INSTALL_PLUGINS=grafana-piechart-panel 1.1.4,mtanda-histogram-panel 0.1.5

Would it be possible to add the possibility to add plugins version?

Using custom config.js

Hi guys,

Really enjoying playing with Grafana so far !
I would like the container to use my own config.js, which specify the datasources like this :

datasources: {
    influxdb: {
        type: 'influxdb',
        url: "http://ip:port/db/mydb",
        username: 'user',
        password: 'pass',
        default: true
    },
    grafana: {
        type: 'influxdb',
        url: "http://ip:port/db/grafana",
        username: 'user',
        password: 'pass',
        grafanaDB: true
    },
},

My guess is I just need to map the correct volume, to force Docker to use my config.js.

docker run -d -p 3000:3000 -v config.js:/??/config.js grafana/grafana

But what is the path in the container of the config,js used by Grafana ?

Separate volume for plugins directory makes it impossible to store /var/lib/grafana in total on a persistent disk

In kubernetes I mount a persistent disk to /var/lib/grafana, however plugins i install in /var/lib/grafana/plugins don't get persisted to that disk.

Presumably because the Dockerfile has those 2 in separate volumes:

VOLUME ["/var/lib/grafana", "/var/lib/grafana/plugins", "/var/log/grafana", "/etc/grafana"]

For what reason is this specified as a separate volume? Wouldn't it make sense to combine the 2?

Change 70b7ce6 breaks ability to manage and mount Grafana config from Docker host

Change 70b7ce6 from Mar. 21st breaks the ability for a configuration management system (Puppet, Chef, etc.) to manage a bind mounted Grafana config, or grafana configuration directory. Whatever security and permissions that the host have set are overridden by the run.sh startup file.

A simple work around might be to convert the grafana.ini file to environment variables, but you can not fully configure this Docker container using environment variables because LDAP support specifically requires an externally managed *.toml configuration file.

Is it really necessary to change the permissions of every single file, even if the Grafana user can already read them? It feels like bad security to go to the trouble of using gosu, but then force the system to allow the unprivileged grafana user to potentially write to sensitive files mounted from the host.

Grafana fails to start with with persistent data volume on host

I've tried mounting a persistent data volume as recommended (on Mac with docker-machine) and grafana does not want to start with following error:

 $ docker run -d -v `pwd`/dev/data/grafana:/var/lib/grafana --name grafana-storage busybox:latest
04e4bc71b005846de8e138cddc929e74158cb341bb8fb81bdfac68b263ead24f 
$ docker run \
>   -d \
>   -p 3000:3000 \
>   --name=grafana \
>   --volumes-from grafana-storage \
>   grafana/grafana
20b94fd4a3b8a92a98d98ec79151bf78e0ceba05935a86704995b0731e610618
$ docker logs grafana
2016/02/29 09:38:23 [I] Starting Grafana
2016/02/29 09:38:23 [I] Version: 2.6.0, Commit: v2.6.0, Build date: 2015-12-14 14:18:01 +0000 UTC
2016/02/29 09:38:23 [I] Configuration Info
Config files:
  [0]: /usr/share/grafana/conf/defaults.ini
  [1]: /etc/grafana/grafana.ini
Command lines overrides:
  [0]: default.paths.data=/var/lib/grafana
  [1]: default.paths.logs=/var/log/grafana
Paths:
  home: /usr/share/grafana
  data: /var/lib/grafana
  logs: /var/log/grafana

2016/02/29 09:38:23 [I] Database: sqlite3
2016/02/29 09:38:23 [I] Migrator: Starting DB migration
2016/02/29 09:38:23 [log.go:75 Fatal()] [E] fail to initialize orm engine: Sqlstore::Migration failed err: unable to open database file

I have tried various combinations, with docker-compose, without it, mounting the volume directly, with a data container, etc. and nothing works. It only works if I don't mount any volume (but then I lose the data on container restart...).

Does grafana/sqlite3 try to write with a specific user or something?

Cannot mount plugins

If I'm mounting a local folder ./grafana/data to /var/lib/grafana and in that local folder I have the dist files of the clock plugin like ./grafana/data/plugins/clock-panel-dist, why is the /var/lib/grafana folder in the container empty when I run docker-compose up?

This is the compose file. Dockerfile in ./grafana doesn't add any layers.

version: "2"
services:
  grafana:
    container_name: grafana
    build: ./grafana
    ports:
      - "9095:9095"
    environment:
      - GF_SERVER_HTTP_PORT=9095
    volumes:
      - ./grafana/data:/var/lib/grafana

I'm looking to start developing my own plugins and decided to try "installing" an official one first, with poor results.

--- edit ---
Basically, before someone asks to do this without Compose:

docker run -v `pwd`/grafana/data:/var/lib/grafana -p 9095:9095 -e GF_SERVER_HTTP_PORT=9095 --name grafana-test grafana/grafana
t=2016-08-04T14:45:10+0000 lvl=info msg="Starting Grafana" logger=main version=3.1.0 commit=v3.1.0 compiled=2016-07-12T06:42:28+0000
t=2016-08-04T14:45:10+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2016-08-04T14:45:10+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2016-08-04T14:45:10+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2016-08-04T14:45:10+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2016-08-04T14:45:10+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2016-08-04T14:45:10+0000 lvl=info msg="Config overriden from Environment variable" logger=settings var="GF_SERVER_HTTP_PORT=9095"
t=2016-08-04T14:45:10+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2016-08-04T14:45:10+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2016-08-04T14:45:10+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2016-08-04T14:45:10+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2016-08-04T14:45:10+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3
t=2016-08-04T14:45:10+0000 lvl=info msg="Starting DB migration" logger=migrator
t=2016-08-04T14:45:10+0000 lvl=info msg="Starting plugin search" logger=plugins
t=2016-08-04T14:45:10+0000 lvl=info msg="Server Listening" logger=server address=0.0.0.0:9095 protocol=http subUrl=

Should perhaps be noted that I'm on OS X, running latest version of native Docker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.