From 9798d402ba95143ddeab5af418af64214513fb20 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 15 Jan 2024 11:51:33 -0600 Subject: [PATCH] Initial commit --- Containerfile | 11 +++++++++++ Jenkinsfile | 1 + start.sh | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 Containerfile create mode 100644 Jenkinsfile create mode 100755 start.sh diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..4ade1ad --- /dev/null +++ b/Containerfile @@ -0,0 +1,11 @@ +FROM registry.fedoraproject.org/fedora-minimal:39 + +RUN --mount=type=cache,target=/var/cache \ + microdnf install -y \ + --setopt install_weak_deps=0 \ + nut \ + && : + +COPY start.sh / + +CMD ["/start.sh"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b8c93a4 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1 @@ +buildContainerImage2(archlist: ['amd64', 'arm64']) diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..d48c002 --- /dev/null +++ b/start.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +install -o root -g nut -m ug=rwx,o= -d /run/nut + +# To automatically update the host's udev rules for NUT devices, +# bind-mount /etc/udev/rules.d into the container. Then, create a +# systemd.path(5) unit to monitor that directory and a +# systemd.service(5) unit to run `udevadm control --reload` and +# `udevadm trigger` when changes are detected. +if mountpoint -q /etc/udev/rules.d; then + cp -uv /lib/udev/rules.d/*-nut-*.rules /etc/udev/rules.d/ + sleep 1 +fi + +upsdrvctl start +exec upsd -FF