Build from Source with Docker

This section describes how to build HELM with Docker.

Simple build

You can compile HELM from source with a Docker build image:

  1. Check out the repository, compile the code, and install the plugin:

    docker build -t myopennmshelmimage .
  2. Run the image:

    docker run -p 3000:3000 -t myopennmshelmimage
  3. Log in to your HELM instance with the default admin credentials (admin/admin).

  4. Navigate to Plugins and enable the OpenNMS Helm plugin.

The Grafana plugin directory location is changed from /var/lib/grafana/plugins to /opt/grafana/plugins. This is because the base Grafana image defines /var/lib/grafana as a volume, which cannot be changed.

Advanced build

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

docker build -t mycustomforkbranch \
            --build-arg OPENNMS_HELM_GIT_URL= \
            --build-arg OPENNMS_HELM_GIT_BRANCH_REF=myBranch

This creates the plugin based on the GitHub URL and branch that you provide.

Build service stack with Docker Compose

The HELM package includes an example docker-compose.yml, which builds a service stack with a compiled Grafana OpenNMS HELM plugin that you can test. You can modify the build arguments in docker-compose.yml if you want to build from a specific GitHub fork, branch, or version tag.

When you first run docker-compose up -d, the Grafana HELM plugin is compiled from the source. Subsequent runs will use the compiled image from your local system. If you want to rebuild the image, run docker-compose build --no-cache.

The URL for your Horizon or Meridian datasource is http://opennms:8980/opennms.

Configure Docker for PDF reports

Horizon and Meridian include templates from which you can create PDF reports. They use an existing Grafana dashboard (see Grafana Dashboard in the main OpenNMS documentation). If you want to use this feature, and you are running HELM through Docker, you must complete additional configuration. Refer to Grafana’s Remote rendering service documentation for more information.