Build with Docker

Simple build

The source can be compiled from source with a Docker builder image.

docker build -t myopennmshelmimage .

will checkout the source from GitHub URL of the project, compile and installs the plugin. The result is a runnable image which can be executed with

docker run -p 3000:3000 -t myopennmshelmimage

Login on http://your-ip:3000 with login admin:admin and go to Plugins and enable the Helm app.

The plugin directory location is changed from /var/lib/grafana/plugins to /opt/grafana/plugins because the base grafana image defines the /var/lib/grafana as a VOLUME which can’t be changed.

Advanced build

If you want to build an image based on a specific GitHub fork or branch you can use --build-arg:

docker build -t mycustomforkbranch \
            --build-arg OPENNMS_HELM_GIT_URL=https://github.com/OpenNMS/opennms-helm.git \
            --build-arg OPENNMS_HELM_GIT_BRANCH_REF=myBranch

This will create the plugin from the given GitHub URL and branch.

Use Docker Compose to build a service stack

There is an example docker-compose.yml which builds a whole service stack with a compiled Grafana OpenNMS Helm App which can be tested.

Modify the build arguments in the docker-compose.yml if you want to build from a GitHub fork, branch or version tag.

With first running docker-compose up -d the Grafana OpenNMS Helm App will be compiled from source. Any run will use the compiled image from on the local system. If you want to rebuild the image run docker-compose build --no-cache to rebuild the image with the build configuration in the given docker-compose.yml.

The URL for the data source in Grafana for the OpenNMS Horizon server is http://opennms:8980/opennms.

Docker configuration for PDF dashboard reports

OpenNMS Horizon/Meridian includes three templates to create a PDF report from an existing Grafana dashboard (see "Creating a PDF of a Grafana Dashboard" in the Horizon/Meridian documentation). If you plan to use this feature and are running Helm with Docker, you must complete additional configuration.

Refer to Grafana’s Remote rendering service documentation for more information on how to set up remote rendering. Additional details are available on GitHub.