Add image@.service to build images as dependencies

This commit is contained in:
Ben 2021-12-27 14:53:06 +01:00
parent b2bafc521e
commit 6f453d0089
Signed by: ben
GPG key ID: 0F54A7ED232D3319

20
image@.service Normal file
View file

@ -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