1
Fork 0
ci-images/pipelines/jobs/simple-image.yml.j2
Lucas Schwiderski a6a9fe59ec
feat: Implement repository mirror
The `oci-build-task` seems to be doing more requests to the registry
than local `docker build`, which frequently results in Docker Hub's
rate limits kicking in.

By proxying `docker.io`, this should hopefully be avoided.

A somewhat elaborate setup and a custom build of `oci-build-task` are
needed: https://github.com/concourse/oci-build-task/pull/121.

Fixes: #39.
2024-08-29 11:58:39 +02:00

52 lines
1.3 KiB
Django/Jinja

{% macro jobs(job) -%}
- name: {{ job.name }}
serial: true
on_success:
put: state-success
resource: status-{{ job.name }}
no_get: true
params:
state: success
sha: ((.:git_sha))
on_failure:
put: state-failure
resource: status-{{ job.name }}
no_get: true
params:
state: failure
sha: ((.:git_sha))
plan:
- get: repo
trigger: true
- load_var: git_sha
file: repo/.git/ref
- put: state-pending
resource: status-{{ job.name }}
no_get: true
params:
state: pending
sha: ((.:git_sha))
- task: build-image
privileged: true
file: repo/tasks/build-image.yml
vars:
context: repo/images/{{ job.name }}
dockerfile: ''
target: ''
registry_url: "((registry_url))"
buildkit_config: "((buildkit_config))"
{%- if "args" in job %}
params:
{%- for name, value in job.args.items() %}
BUILD_ARG_{{name}}: "{{value}}"
{%- endfor %}
{%- endif %}
- put: image-{{ job.name }}
inputs: detect
params: { image: image/image.tar }
no_get: true
{%- endmacro -%}
{# vim: ft=yaml-jinja #}