Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions images/nut-upsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.authors="Rich Braun docker@instantlinux.net" \
org.label-schema.name=nut-upsd \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=https://github.com/instantlinux/docker-tools
ARG NUT_VERSION=2.8.2-r2
ARG NUT_VERSION=2.8.3-r2
ENV API_USER=upsmon \
API_PASSWORD= \
DESCRIPTION=UPS \
Expand All @@ -21,13 +21,16 @@ ENV API_USER=upsmon \
SECRETNAME=nut-upsd-password \
SERIAL= \
SERVER=master \
ULIMIT=2048 \
USER=nut \
VENDORID=
HEALTHCHECK CMD upsc $NAME@localhost:3493 2>&1|grep -q stale && \
killall -TERM upsmon || true

RUN apk add --no-cache dash && \
apk add --update --no-cache nut=$NUT_VERSION \
RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' \
>>/etc/apk/repositories && \
apk add --no-cache dash && \
apk add --update --no-cache nut@edge=$NUT_VERSION \
busybox linux-pam \
libcrypto3 libssl3 \
libusb musl net-snmp-libs util-linux
Expand Down
3 changes: 3 additions & 0 deletions images/nut-upsd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ SDORDER | | UPS shutdown sequence, set to -1 to disable shutdown
SECRETNAME | nut-upsd-password | name of secret to use for API user
SERIAL | | hardware serial number of UPS
SERVER | master | master or slave priority for scripts
ULIMIT | 2048 | open-files ulimit
USER | nut | local user
VENDORID | | vendor ID for ups.conf
### Notes
Expand Down Expand Up @@ -115,6 +116,8 @@ EOF
udevadm control --reload-rules && udevadm trigger
```

When starting up under Debian trixie, an out-of-memory error can be prevented by setting the nofile ulimit to a smaller value than system default: see [issue #1672](https://github.com/networkupstools/nut/issues/1672). The default is set here to 2048.

### Secrets

If the API user needs a password, you have two ways to specify it: pass the value itself as environment variable API_PASSWORD, or define a Docker secret as follows:
Expand Down
1 change: 1 addition & 0 deletions images/nut-upsd/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ chown $USER:$GROUP /dev/shm/nut
echo 0 > /var/run/nut/upsd.pid && chown $USER:$GROUP /var/run/nut/upsd.pid
echo 0 > /var/run/upsmon.pid

ulimit -n $ULIMIT
/usr/sbin/upsdrvctl -u root start
/usr/sbin/upsd -u $USER
exec /usr/sbin/upsmon -D
Loading