From 09bf2c8f888c60aa06fc18b1c81e4523510e80be Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Fri, 6 Oct 2017 07:09:40 +0000 Subject: [PATCH] add version tag for the docker images docker images are also tagged with the same image version. --- files/build_templates/sonic_debian_extension.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 04f5181ff610..8270af923078 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -193,7 +193,10 @@ sudo cp $IMAGE_CONFIGS/platform/rc.local $FILESYSTEM_ROOT/etc/ {% if installer_images.strip() -%} {% for image in installer_images.strip().split(' ') -%} +{% set imagefilename = image.split('/')|last -%} +{% set imagename = imagefilename.split('.')|first -%} sudo LANG=C chroot $FILESYSTEM_ROOT docker load < {{image}} +sudo LANG=C chroot $FILESYSTEM_ROOT docker tag {{imagename}}:latest {{imagename}}:$(sonic_get_version) {% endfor %} sudo chroot $FILESYSTEM_ROOT service docker stop {% for script in installer_start_scripts.split(' ') -%}