grafana-docker-dev
For setting up the grafana environment in docker and developing in a windows host (via boot2docker). Nothing too clever, when running from __main__ sets up a virtual box with symlinks, and links the environment to a shared folder on your windows host. Could be run with a unix host as well with a few small modifications.
Assumes that you have a checked out version of the grafana source code on your shared location.
Steps are:
-
Build the boot2docker VM environment (docker_delete, docker_create, docker_init_share)
-
Build the Dockerfile image on the selected VM (docker_build)
-
Run the resulting docker image using:
docker run -it -p 3000:3000 --rm --volume /Users:/usr/share/grafana-src/src/github.com/grafana/grafana \ --name grafana-dev grafana-dev-image
This will run npm build, the Grafana setup scripts, build and install,
grunt watch
andbra run
. You can then edit your local copy of Grafana and the running container should update accordingly, so you should then be able to view any changes (fairly) immediately in your browser. -
When you want to deploy, you can attach another session to the running container:
docker exec -it grafana-dev /bin/bash
. Then change directorycd src/github.com/grafana/grafana
and finally rungo run build.go build package
. This will generate the deb package. -
Finally, you can run the last step in __main__ (deploy_docker_build, docker_push and docker_login)