-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathDockerfile
51 lines (40 loc) · 1.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:20.04
LABEL maintainer="e1z0"
ENV NUT_VERSION 2.7.4
ENV UPS_NAME="ups"
ENV UPS_DESC="UPS"
ENV UPS_DRIVER="usbhid-ups"
ENV UPS_PORT="auto"
ENV API_PASSWORD=""
ENV ADMIN_PASSWORD=""
ENV SHUTDOWN_CMD="echo 'System shutdown not configured!'"
RUN apt-get update && apt-get install -y build-essential wget libusb-dev curl && \
# download and extract
cd /tmp && \
wget http://www.networkupstools.org/source/2.7/nut-$NUT_VERSION.tar.gz && \
tar xfz nut-$NUT_VERSION.tar.gz && \
cd nut-$NUT_VERSION && \
./configure \
--prefix=/usr \
--sysconfdir=/etc/nut \
--disable-dependency-tracking \
--enable-strip \
--disable-static \
--with-all=no \
--with-usb=yes \
--datadir=/usr/share/nut \
--with-drvpath=/usr/share/nut \
--with-statepath=/var/run/nut \
--with-user=root \
--with-group=root \
&& \
make install && \
# create nut user
install -d -m 750 -o root -g root /var/run/nut && \
rm -rf /tmp/nut-$NUT_VERSION.tar.gz /tmp/nut-$NUT_VERSION
COPY src/docker-entrypoint /usr/local/bin/
COPY src/flux_mon /usr/local/bin/
COPY shutdown-client/shutdown-client /usr/local/bin/
ENTRYPOINT ["docker-entrypoint"]
WORKDIR /var/run/nut
EXPOSE 3493