From dc0f3ceb5c742c4e588388fe4f506b2728343d7e Mon Sep 17 00:00:00 2001 From: lguohan Date: Sun, 8 Oct 2017 02:10:14 -0700 Subject: [PATCH] add version tag for the docker images (#1021) 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 04f5181ff6..8270af9230 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(' ') -%}