sonic-buildimage/files/build_templates/packages.json.j2
Stepan Blyshchak cd2c86eab6
[dockers] label SONiC Docker with manifest (#5939)
Signed-off-by: Stepan Blyschak stepanb@nvidia.com

This PR is part of SONiC Application Extension

Depends on #5938

- Why I did it
To provide an infrastructure change in order to support SONiC Application Extension feature.

- How I did it
Label every installable SONiC Docker with a minimal required manifest and auto-generate packages.json file based on
installed SONiC images.

- How to verify it
Build an image, execute the following command:

admin@sonic:~$ docker inspect docker-snmp:1.0.0 | jq '.[0].Config.Labels["com.azure.sonic.manifest"]' -r | jq
Cat /var/lib/sonic-package-manager/packages.json file to verify all dockers are listed there.
2021-04-26 13:51:50 -07:00

18 lines
697 B
Django/Jinja

{
{% for docker_installation_target in installer_images.strip().split() -%}
{% set pkgname, docker_build_path, image = docker_installation_target.split('|') -%}
{% set imagefilepath = image.split(':')|first -%}
{% set imageversion = image.split(':')|last -%}
{% set imagefilename = imagefilepath.split('/')|last -%}
{% set imagename = imagefilename.split('.')|first -%}
"{{ pkgname }}": {
"repository": "{{ imagename }}",
"description": "SONiC {{ pkgname }} package",
"default-reference": "{{ imageversion }}",
"installed-version": "{{ imageversion }}",
"built-in": true,
"installed": true
}{% if not loop.last %},{% endif %}
{% endfor %}
}