From 4044a3475e51f763f8d4f3feda003f0a4837f177 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 23 May 2016 10:15:38 +0800 Subject: Pin the base distro release version Pin the base distro release version in the master branch(Newton). Only one distro version is supported. The supported versions are: * CentOS: 7 * RedHat: 7 * OracleLinux: 7 * Debian: 8 * Ubuntu: 14.04 NOTE: Kolla will move to Ubuntu 16.04 in the Newton cycle DocImpact TrivialFix Change-Id: I32c0edbee4de14c8a0cc7c961d566e84d70f19a4 --- docker/base/Dockerfile.j2 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docker/base') diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 07fbf8b0d..84a4fd374 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -24,6 +24,9 @@ ENV PS1="$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(ho {% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %} +RUN if [ $(awk '{match($0, /[0-9]+/,version)}END{print version[0]}' /etc/system-release) != "{{ supported_distro_release }}" ]; then \ + echo "Only supported {{ supported_distro_release }} release on {{ base_distro }}"; false; fi + # Customize PS1 bash shell RUN cat /tmp/kolla_bashrc >> /etc/bashrc @@ -181,6 +184,9 @@ RUN yum -y install \ {# endif for base_distro centos,fedora,oraclelinux,rhel #} {% elif base_distro in ['ubuntu', 'debian'] %} +RUN if [ $(awk -F '=' '/DISTRIB_RELEASE/{print $2}' /etc/lsb-release) != "{{ supported_distro_release }}" ]; then \ + echo "Only supported {{ supported_distro_release }} release on {{ base_distro }}"; false; fi + # Customize PS1 bash shell RUN cat /tmp/kolla_bashrc >> /etc/bash.bashrc -- cgit v1.2.3