From 8561db2aee22faab1114b77b736579c678fa9b83 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Wed, 6 Jul 2022 12:59:34 +0200 Subject: [PATCH] Try to enable metrics for apcupsd. --- Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99a6b59..8d5b277 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ +FROM golang:alpine AS build +MAINTAINER chris +RUN apk add git --no-cache && \ + go get -u github.com/mdlayher/apcupsd_exporter && \ + go get -t -v ./... + FROM alpine:latest RUN apk update && apk upgrade -RUN apk add --no-cache libusb apcupsd apcupsd-doc apcupsd-webif apache2 +RUN apk add --no-cache libusb apcupsd -COPY apache2.conf /etc/apache2/httpd.conf COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf +COPY --from=build /go/bin/apcupsd_exporter /sbin/apcupsd_exporter -EXPOSE 80 3551/tcp 3551/udp +EXPOSE 9162 3551/tcp 3551/udp -ENTRYPOINT httpd -k start && /sbin/apcupsd -b +ENTRYPOINT /sbin/apcupsd -b && /sbin/apcupsd_exporter -apcupsd.addr localhost:3551