From ad3c18608f2eb02db148faff15eb3ac7c99b7526 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 26 Jan 2021 13:08:22 +0100 Subject: [PATCH] base: print release version in case of running unsupported one User may provide own base image but it needs to be supported one. If it is not then we print info and error out. So provide user with info which release is present in their image. Change-Id: I0d8417fdeb2f02138d03cc57bd3b7b95bc43fc8f --- docker/base/Dockerfile.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 2af50509fb..8cb093be4b 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -271,8 +271,8 @@ RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("cen # Ensure lsb_release exists {{ macros.install_packages(['lsb-release']) }} -RUN if [ $(lsb_release -r -s) != "{{ supported_distro_release }}" ]; then \ - echo "Only release '{{ supported_distro_release }}' is supported on {{ base_distro }}"; false; fi +RUN RELEASE=$(lsb_release -r -s); if [ $RELEASE != "{{ supported_distro_release }}" ]; then \ + echo "Only release '{{ supported_distro_release }}' is supported on {{ base_distro }} while you have '$RELEASE'."; false; fi # Customize PS1 bash shell # enlarge 'system users' range so 'haproxy' package will not complain