Put all build args into env vars in image@.service

This commit is contained in:
Ben 2021-12-27 18:29:25 +01:00
parent 3c195de86f
commit a43545a28b
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -10,7 +10,8 @@ Type=oneshot
Environment=PODMAN_SYSTEMD_UNIT=%n Environment=PODMAN_SYSTEMD_UNIT=%n
LogExtraFields=IMAGE=%i LogExtraFields=IMAGE=%i
ExecCondition=/usr/bin/bash -c '[[ $(podman images --format json localhost/%i | jq .\\[0\\]) == "null" ]]' ExecCondition=/usr/bin/bash -c '[[ $(podman images --format json localhost/%i | jq .\\[0\\]) == "null" ]]'
ExecStart=/usr/bin/podman build --tag localhost/%i $EXTRAOPTS /docker/containers/%i Environment="IMAGE_TAG=localhost/%i" "BUILD_SOURCE=/docker/containers/%i"
ExecStart=/usr/bin/podman build --tag ${IMAGE_TAG} $EXTRAOPTS ${BUILD_SOURCE}
Restart=no Restart=no
RemainAfterExit=yes RemainAfterExit=yes
TimeoutStartSec=1h TimeoutStartSec=1h