15 lines
529 B
Django/Jinja
15 lines
529 B
Django/Jinja
[Unit]
|
|
Description=Pre-pull Docker images for CI runner cache
|
|
After=docker.service
|
|
Wants=docker.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
Environment=DOCKER_HOST=unix:///run/user/{{ gitea_runner_uid }}/docker.sock
|
|
Environment=XDG_RUNTIME_DIR=/run/user/{{ gitea_runner_uid }}
|
|
# Pull each image quietly. docker pull exits 0 if image is already up-to-date,
|
|
# so this is idempotent. Errors are non-fatal (image may already be cached).
|
|
{% for image in gitea_runner_pre_cache_images %}
|
|
ExecStart=/usr/bin/docker pull -q {{ image }}
|
|
{% endfor %}
|