A compact docker image with:Grafana.
4.3K
A compact docker image based on debian:jessie with:
In addition to having node and java installed, this image
comes with kms-env installed.
If you pass in environment variables encrypted using kms-env.
The image will automatically decrypt them.
In order for decryption to work, your docker container must be running on an ec2-instance with a role that has access to AWS KMS (and the master key used for encryption).
Nginx is used for enabling reverse proxy for grafana.
The docker image is published in Docker Hub.
When code is pushed to the master branch, hooks in Docker Hub will rebuild the latest image.
docker build -t docker-grafana/latest .
docker run --rm -d \
-p 3000:3000 \
--name=grafana \
-e "GF_SECURITY_ADMIN_USER=admin" \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
docker-grafana/latest
Notes:
--rm will destroy existing container.Now you should be able to visit http://localhost:3000/.
Make sure MySQL configuration file has the following configuration. This is necessary so that the docker container can talk to the host.
bind-address = 0.0.0.0
Setup the user test in MySQL (the root password in this case is blank):
$ mysql -u root -p
Enter password: <ENTER>
mysql> create user 'test'@'%%' identified by 'testtest';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'test'@'%%';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
Setup a database called grafana:
$ mysql -u test -p
Enter password: testtest<ENTER>
mysql> create database grafana;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye
Replace <host machine name or ip> with the docker host name or IP address.
host_ip=<host machine name or ip>
docker run --rm -d \
-p 3000:3000 \
--name=grafana \
-e "GF_SECURITY_ADMIN_USER=admin" \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
-e "GF_DATABASE_TYPE=mysql" \
-e "GF_DATABASE_HOST=${host_ip}:3306" \
-e "GF_DATABASE_USER=test" \
-e "GF_DATABASE_PASSWORD=testtest" \
-e "GF_DATABASE_NAME=grafana" \
--net="bridge" \
docker-grafana/latest
Now you should be able to visit `http://localhost:3000/`.
If you destroy the container and restart it, it should have persisted
information such as data sources and dashboards.
## Log into the container
```bash
docker exec -it grafana bash
docker rm -f grafana
Content type
Image
Digest
Size
174.3 MB
Last updated
over 8 years ago
docker pull loyaltyone/docker-grafana