From da81d87f7b452f9c31396bce8272f4d523add713 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Wed, 6 Jul 2022 13:55:38 +0200 Subject: [PATCH] Try building with correct build base. --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index aeda274..661a817 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ +FROM golang:alpine AS build +MAINTAINER chris +RUN apk add git --no-cache && \ + git clone https://github.com/mdlayher/apcupsd_exporter /tmp/build && \ + cd /tmp/build && \ + go build -o /go/bin/apcupsd_exporter /tmp/build/cmd/apcupsd_exporter/main.go + FROM alpine:latest - RUN apk update && apk upgrade && apk add --no-cache libusb apcupsd - COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf -EXPOSE 3551/tcp 3551/udp - -ENTRYPOINT /sbin/apcupsd -b +COPY --from=build /go/bin/apcupsd_exporter /sbin/apcupsd_exporter +EXPOSE 9162 3551/tcp 3551/udp +ENTRYPOINT /sbin/apcupsd -b && /sbin/apcupsd_exporter -apcupsd.addr localhost:3551 \ No newline at end of file