Improved README.md

This commit is contained in:
fey 2026-09-16 00:09:40 +02:00
parent 61274350d5
commit f489e4bad1

View File

@ -4,9 +4,26 @@ This is a Java application that exports metrics from a Digital Devices OctopusNE
## How to run? ## How to run?
* Option 1: Set the OCTONET_IP environment variable to the IP address of your OctopusNET device and run the application using `mvn exec:java`. ### Option 1: Using Maven
* Option 2: There's are pre-built binary supplied in the download archive. You can use this by setting the OCTONET_IP environment variable to the IP address of your OctopusNET device and then run the application using `java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar`. This requires an installed Java Development Kit (JDK) version 17 or higher.
* Option 3 (recommended): Use the provided Dockerfile to build a container and run this application in Docker or Podman. Don't forget to supply an `-e OCTONET_IP=<your_octonet_ip>` to the container.
Set the OCTONET_IP environment variable to the IP address of your OctopusNET device and run the application using `mvn exec:java`.
#### Option 2: Using the precompiled binary
This requires an installed Java Runtime Environment (JRE) version 17 or higher.
There's a pre-built binary supplied in the download archive. You can use this by setting the OCTONET_IP environment variable to the IP address of your OctopusNET device and then run the application using `java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar`.
HINT: If you're using a Unix-based system like macOS or Linux, you can manipulate the environment variables non-permanently on the fly by using something like `OCTONET_IP=172.20.20.121 java -jar octonet-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar`
### Option 3 (recommended): Using Docker or Podman
Use the provided Dockerfile to build a container and run this application in Docker or Podman. Don't forget to supply an `-e OCTONET_IP=<your_octonet_ip>` to the container.
For example:
```bash
docker build -t octonet-exporter .
docker run -d -p 9401:9401 -e OCTONET_IP=172.20.20.121 octonet-exporter
```
## How to compile a binary? ## How to compile a binary?