Files
apc-container/Dockerfile

18 lines
474 B
Docker

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
COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf
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