You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker: Custom dockerfiles, docker and image rendering docs update (grafana#20492)
Adds support for using custom dockerfiles to pre-install image
renderer plugins.
Updates docs for docker and image rendering.
Fixesgrafana#20241
Co-Authored-By: Leonard Gram <[email protected]>
Copy file name to clipboardexpand all lines: docs/sources/administration/image_rendering.md
+96-8
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,22 @@ When an image is being rendered the PNG-image is temporary written to the filesy
17
17
18
18
A background job runs each 10 minutes and will remove temporary images. You can configure how long time an image should be stored before being removed by configuring the [temp-data-lifetime](/installation/configuration/#temp-data-lifetime) setting.
19
19
20
-
## Rendering methods
21
-
22
-
### PhantomJS
20
+
## Requirements
23
21
24
-
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to Grafana image renderer plugin or remote rendering service.
22
+
Rendering images may require quite a lot of memory, mainly because there are "browser instances" started in the
23
+
background responsible for the actual rendering. Further, if multiple images are being rendered in parallel it most
24
+
certainly has a bigger memory footprint. Minimum free memory recommendation is 1GB.
25
25
26
-
[PhantomJS](https://phantomjs.org/) have been the only supported and default image renderer since Grafana v2.x and is shipped with Grafana.
26
+
Depending on [rendering method](#rendering-methods) you would need that memory available in the system where the
27
+
rendering process is running. For [Grafana Image renderer plugin](#grafana-image-renderer-plugin) and [PhantomJS](#phantomjs)
28
+
it's the system which Grafana is installed on. For [Remote rendering service](#remote-rendering-service) it is the system where
29
+
that's installed.
27
30
28
-
Please note that for macOS and Windows, you will need to ensure that a phantomjs binary is available under tools/phantomjs/phantomjs. For Linux, a phantomjs binary is included - however, you should ensure that any required libraries, e.g. libfontconfig1, are available.
31
+
## Rendering methods
29
32
30
33
### Grafana image renderer plugin
31
34
32
-
> This plugin currently does not work if it is installed in Grafana docker image.
35
+
> This plugin currently does not work if it is installed in the Grafana docker image. See [Install in Grafana docker image](#install-in-grafana-docker-image).
33
36
34
37
The [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) is a plugin that runs on the backend and handles rendering panels and dashboards as PNG-images using headless chrome.
35
38
@@ -39,7 +42,13 @@ You can install it using grafana-cli:
For further information and instructions refer to the [plugin details](https://grafana.com/grafana/plugins/grafana-image-renderer).
45
+
For further information and instructions refer to [troubleshooting](#troubleshooting) and the [plugin details](https://grafana.com/grafana/plugins/grafana-image-renderer).
46
+
47
+
#### Install in Grafana docker image
48
+
49
+
This plugin is not compatible with the current Grafana Docker image without installing further system-level dependencies. We recommend setting up another Docker container for rendering and using remote rendering, see [Remote rendering service](#remote-rendering-service) for reference.
50
+
51
+
If you still want to install the plugin in the Grafana docker image we provide instructions for how to build a custom Grafana image, see [Installing using Docker](/installation/docker/#custom-image-with-grafana-image-renderer-plugin-pre-installed).
For further information and instructions refer to [troubleshooting](#troubleshooting) and the [plugin details](https://grafana.com/grafana/plugins/grafana-image-renderer).
115
+
116
+
### PhantomJS
117
+
118
+
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to Grafana image renderer plugin or remote rendering service.
119
+
120
+
[PhantomJS](https://phantomjs.org/) have been the only supported and default image renderer since Grafana v2.x and is shipped with Grafana.
121
+
122
+
PhantomJS binaries are included for Linux (x64), Windows (x64) and Darwin (x64). For Linux you should ensure that any required libraries, e.g. libfontconfig1, are available.
123
+
124
+
Please note that PhantomJS binaries are not included for ARM. To support this you will need to ensure that a phantomjs binary is available under tools/phantomjs/phantomjs.
125
+
105
126
## Alerting and render limits
106
127
107
128
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit](/installation/configuration/#concurrent-render-limit).
108
129
130
+
## Troubleshooting
131
+
132
+
Enable debug log messages for rendering in the Grafana configuration file and inspect the Grafana server log.
133
+
134
+
```bash
135
+
[log]
136
+
filters = rendering:debug
137
+
```
138
+
139
+
### Grafana image renderer plugin and remote rendering service
140
+
141
+
The plugin and rendering service uses [Chromium browser](https://www.chromium.org/) which depends on certain libraries.
142
+
If you don't have all of those libraries installed in your system you may encounter errors when trying to render an image, e.g.
143
+
144
+
```bash
145
+
Rendering failed: Error: Failed to launch chrome!/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome:
146
+
error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
147
+
```
148
+
149
+
In general you can use the [`ldd`](https://en.wikipedia.org/wiki/Ldd_(Unix)) utility to figure out what shared libraries
The official Grafana Docker image comes in two variants.
58
+
59
+
**`grafana/grafana:<version>`:**
60
+
61
+
> **Note:** This image was based on [Ubuntu](https://ubuntu.com/) before version 6.4.0.
62
+
63
+
This is the default image. This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the alpine official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images, and thus leads to slimmer and more secure images.
64
+
65
+
This variant is highly recommended when security and final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice.
66
+
67
+
**`grafana/grafana:<version>-ubuntu`:**
68
+
69
+
> **Note:** This image is available since version 6.5.0.
70
+
71
+
This image is based on [Ubuntu](https://ubuntu.com/), available in [the ubuntu official image](https://hub.docker.com/_/ubuntu).
72
+
This is an alternative image for those who prefer an [Ubuntu](https://ubuntu.com/) based image and/or who are dependent on certain
73
+
tooling not available for Alpine.
74
+
56
75
## Running a specific version of Grafana
57
76
58
77
```bash
59
-
# specify right tag, e.g. 5.1.0 - see Docker Hub for available tags
60
-
$ docker run \
61
-
-d \
62
-
-p 3000:3000 \
63
-
--name grafana \
64
-
grafana/grafana:5.1.0
78
+
# specify right tag, e.g. 6.5.0 - see Docker Hub for available tags
79
+
$ docker run -d -p 3000:3000 --name grafana grafana/grafana:6.5.0
80
+
# ubuntu based images available since Grafana 6.5.0
81
+
$ docker run -d -p 3000:3000 --name grafana grafana/grafana:6.5.0-ubuntu
65
82
```
66
83
67
84
## Running the master branch
68
85
69
-
For every successful build of the master branch we update the `grafana/grafana:master`tag and create a new tag `grafana/grafana-dev:master-<commit hash>`with the hash of the git commit that was built. This means you can always get the latest version of Grafana.
86
+
For every successful build of the master branch we update the `grafana/grafana:master` and `grafana/grafana:master-ubuntu`. Additionally, two new tags are created, `grafana/grafana-dev:master-<commit hash>`and `grafana/grafana-dev:master-<commit hash>-ubuntu`, which includes the hash of the git commit that was built. This means you can always get the latest version of Grafana.
70
87
71
88
When running Grafana master in production we **strongly** recommend that you use the `grafana/grafana-dev:master-<commit hash>` tag as that will guarantee that you use a specific version of Grafana instead of whatever was the most recent commit at the time.
72
89
73
-
For a list of available tags, check out [grafana/grafana](https://hub.docker.com/r/grafana/grafana/tags/) and [grafana/grafana-dev](https://hub.docker.com/r/grafana/grafana-dev/tags/).
90
+
For a list of available tags, check out [grafana/grafana](https://hub.docker.com/r/grafana/grafana/tags/) and [grafana/grafana-dev](https://hub.docker.com/r/grafana/grafana-dev/tags/).
74
91
75
92
## Installing Grafana plugins
76
93
77
94
Pass the plugins you want installed to docker with the `GF_INSTALL_PLUGINS` environment variable as a comma separated list. This will pass each plugin name to `grafana-cli plugins install ${plugin}` and install them when Grafana starts.
> If you need to specify the version of a plugin, you can add it to the `GF_INSTALL_PLUGINS` environment variable. Otherwise, the latest will be assumed. For example: `-e "GF_INSTALL_PLUGINS=grafana-clock-panel 1.0.1,grafana-simple-json-datasource 1.3.5"`
89
105
90
-
## Building a custom Grafana image with pre-installed plugins
106
+
## Building a custom Grafana image
107
+
108
+
In the [Grafana GitHub repository](https://github.com/grafana/grafana/tree/master/packaging/docker) there is a folder called `custom/` which two includes Dockerfiles, `Dockerfile` and `ubuntu.Dockerfile`, that can be used to build a custom Grafana image.
109
+
It accepts `GRAFANA_VERSION`, `GF_INSTALL_PLUGINS` and `GF_INSTALL_IMAGE_RENDERER_PLUGIN` as build arguments.
91
110
92
-
In the [grafana-docker](https://github.com/grafana/grafana/tree/master/packaging/docker) there is a folder called `custom/` which includes a `Dockerfile` that can be used to build a custom Grafana image. It accepts `GRAFANA_VERSION` and `GF_INSTALL_PLUGINS` as build arguments.
111
+
### With pre-installed plugins
112
+
113
+
> If you need to specify the version of a plugin, you can add it to the `GF_INSTALL_PLUGINS` build argument. Otherwise, the latest will be assumed. For example: `--build-arg "GF_INSTALL_PLUGINS=grafana-clock-panel 1.0.1,grafana-simple-json-datasource 1.3.5"`
docker run -d -p 3000:3000 --name=grafana grafana-custom
106
124
```
107
125
108
-
> If you need to specify the version of a plugin, you can add it to the `GF_INSTALL_PLUGINS` build argument. Otherwise, the latest will be assumed. For example: `--build-arg "GF_INSTALL_PLUGINS=grafana-clock-panel 1.0.1,grafana-simple-json-datasource 1.3.5"`
126
+
Replace `Dockerfile` in above example with `ubuntu.Dockerfile` to build a custom Ubuntu based image (Grafana 6.5+).
127
+
128
+
### With Grafana Image Renderer plugin pre-installed
129
+
130
+
> Only available in Grafana v6.5+ and experimental.
131
+
132
+
The [Grafana Image Renderer plugin](/administration/image_rendering/#grafana-image-renderer-plugin) does not
133
+
currently work if it is installed in Grafana docker image.
134
+
You can build a custom docker image by using the `GF_INSTALL_IMAGE_RENDERER_PLUGIN` build argument.
135
+
This will install additional dependencies needed for the Grafana Image Renderer plugin to run.
## Migration from a previous version of the docker container to 6.4 or later
286
+
287
+
Grafana’s docker image was changed to be based on [Alpine](http://alpinelinux.org) instead of [Ubuntu](https://ubuntu.com/).
288
+
289
+
## Migration from a previous version of the docker container to 6.5 or later
290
+
291
+
Grafana Docker image now comes in two variants, one [Alpine](http://alpinelinux.org) based and one [Ubuntu](https://ubuntu.com/) based, see [Image Variants](#image-variants) for details.
292
+
252
293
## Logging in for the first time
253
294
254
295
To run Grafana open your browser and go to http://localhost:3000/. 3000 is the default HTTP port that Grafana listens to if you haven't [configured a different port](/installation/configuration/#http-port).
Copy file name to clipboardexpand all lines: docs/sources/installation/upgrading.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -196,9 +196,15 @@ is `7.0+` and `max concurrent shard requests` properly configured. 256 was the d
196
196
197
197
## Upgrading to v6.4
198
198
199
+
### Annotations database migration
200
+
199
201
One of the database migrations included in this release will merge multiple rows used to represent an annotation range into a single row. If you have a large number of region annotations the database migration may take a long time to complete. See [Upgrading to v5.2](#upgrading-to-v5-2) for tips on how to manage this process.
200
202
201
-
Plugins that need updating:
203
+
### Docker
204
+
205
+
Grafana’s docker image is now based on [Alpine](http://alpinelinux.org) instead of [Ubuntu](https://ubuntu.com/).
0 commit comments