HON95 / prometheus-nut-exporter

A Prometheus exporter for Network UPS Tools (NUT)
GNU General Public License v3.0
92 stars 17 forks source link

arm64 image? #15

Closed bjschafer closed 2 years ago

bjschafer commented 2 years ago

Hey,

Would it be possible to publish arm64 images to Dockerhub? The current Dockerfile build just fine on arm64 with a minor tweak -- I'd be happy to submit it as a PR if you'd like:

diff --git a/Dockerfile b/Dockerfile
index cde5e3b..db751fb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -38,7 +38,7 @@ WORKDIR /app

 # Add tini to properly handle signals
 ARG TINI_VERSION
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
+ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 /tini
 RUN chmod +x /tini

 # Add non-root user

I'm not particularly familiar with building multi-arch Docker images, but a hacky workaround could be done in shell to get the correct Tini filename with something like this:

case "$(uname -m)" in
    aarch64)
        TINI_NAME='tini-arm64'
        ;;
    *)
        TINI_NAME='tini'
        ;;
esac

Thanks!

HON95 commented 2 years ago

Thanks for the suggestion and examples, I need to think about the best approach to support multi-arch builds in my projects when I get the time.

Julius112 commented 2 years ago

Hi,

I'm really interested to get this up and running on ARM as well. Is there already a solution? If not, I would be happy to contribute to setup an ARM build.

Cheers, Julius

ShlomiD83 commented 2 years ago

Thanks for the suggestion and examples, I need to think about the best approach to support multi-arch builds in my projects when I get the time.

Hi, Any progress regarding an Arm64 image?

HON95 commented 2 years ago

I might have time to work on this today or tomorrow, actually. Finally have my homelab running again (the relevant parts anyways).

ShlomiD83 commented 2 years ago

Are there any other steps I have to follow besides deploying this docker and editing the prometheus.yml file? I get No Data from Grafana after following all the steps.

HON95 commented 2 years ago

hon95/prometheus-nut-exporter:latest (bleeding) should work with arm64 now. I don't have a RasPi 4, though, could anyone here test it before I make a release? I've tested it with RasPis 1B (armv6) and 3B (armv7).

HON95 commented 2 years ago

Implemented in #28.

ShlomiD83 commented 2 years ago

thanks, it works great on my RPi4 with grafana.