27 lines
676 B
Django/Jinja
27 lines
676 B
Django/Jinja
#!/bin/bash
|
|
# {{ ansible_managed }}
|
|
_term() {
|
|
echo "Received SIGTERM, stopping all containers"
|
|
kill "$child"
|
|
}
|
|
|
|
podman system service -t 0 &
|
|
|
|
podman run \
|
|
--rm \
|
|
-v /run/secrets:/run/secrets:ro \
|
|
{% for key, value in pinp_inner_env.items() %}
|
|
-e {{ key }}={{ value }} \
|
|
{% endfor %}
|
|
-v /tmp/storage-run-1000/podman/podman.sock:/var/run/docker.sock \
|
|
{% for mount in pinp_inner_mounts %}
|
|
--mount type={{ mount.type }},source={{ mount.source }},destination={{ mount.destination }}{% if mount.readonly | default(false) %},readonly{% endif %} \
|
|
{% endfor %}
|
|
--name {{ pinp_inner_name }} \
|
|
--network host \
|
|
{{ pinp_inner_image }} &
|
|
|
|
child=$!
|
|
trap _term SIGTERM
|
|
wait "$!"
|