From 6f453d0089b125138169aef4436e2584f445bdfe Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Mon, 27 Dec 2021 14:53:06 +0100 Subject: [PATCH] Add image@.service to build images as dependencies --- image@.service | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 image@.service diff --git a/image@.service b/image@.service new file mode 100644 index 0000000..c03a38b --- /dev/null +++ b/image@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Podman image@%i +Wants=network.target +After=network-online.target +StartLimitIntervalSec=1h +StartLimitBurst=3 + +[Service] +Type=oneshot +Environment=PODMAN_SYSTEMD_UNIT=%n +LogExtraFields=IMAGE=%i +ExecCondition=/usr/bin/bash -c '[[ $(podman images --format json localhost/%i | jq .\\[0\\]) == "null" ]]' +ExecStart=/usr/bin/podman build --pull-always --tag localhost/%i $EXTRAOPTS /docker/containers/%i +Restart=no +RemainAfterExit=yes +TimeoutStartSec=1h +SendSIGKILL=no +LogRateLimitIntervalSec=15min +LogRateLimitBurst=1500 +