2021-01-09 00:23:46 +01:00
|
|
|
FROM debian:buster-slim
|
2021-01-02 16:54:47 +01:00
|
|
|
|
2021-01-08 12:50:14 +01:00
|
|
|
ENV NAME ups
|
2021-01-02 16:54:47 +01:00
|
|
|
ENV DRIVER usbhid-ups
|
|
|
|
ENV PORT auto
|
|
|
|
ENV POLLFREQ 5
|
|
|
|
ENV DESC UPS
|
2021-01-08 12:50:14 +01:00
|
|
|
ENV USERSSTRING #
|
2021-01-02 16:54:47 +01:00
|
|
|
|
2021-01-08 23:55:53 +01:00
|
|
|
#Installing default packages
|
2021-01-08 10:41:33 +01:00
|
|
|
RUN apt-get update
|
2021-01-08 23:55:53 +01:00
|
|
|
RUN apt-get install -y \
|
|
|
|
nut-server
|
|
|
|
|
|
|
|
#Apply configuration
|
|
|
|
RUN sed -i 's/MODE=none/MODE=netserver/g' /etc/nut/nut.conf \
|
|
|
|
&& echo "LISTEN 0.0.0.0 3493" >> /etc/nut/upsd.conf \
|
|
|
|
&& echo -e "[$NAME] \n driver = $DRIVER \n port = $PORT \n pollfreq = $POLLFREQ \n desc = $DESC" >> /etc/nut/ups.conf \
|
|
|
|
&& echo -e "$USERSSTRING" >> /etc/nut/upsd.users \
|
|
|
|
&& chgrp nut /etc/nut/*
|
2021-01-02 16:54:47 +01:00
|
|
|
|
|
|
|
COPY entrypoint.sh /
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
|
EXPOSE 3493
|