From 0661ee3e30ffc8e2c17ed4f8e6df4986ba568aee Mon Sep 17 00:00:00 2001 From: Alexey Deryugin Date: Wed, 27 May 2015 19:49:30 +0300 Subject: [PATCH] Update Docker DIB elements for usage with Debian-based images Change-Id: I319c28b5314f9d8ee070a0cafe10968851adf64c --- .../elements/docker/install.d/56-docker | 22 ++++++++++++++++--- .../elements/docker/install.d/56-docker | 22 ++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/DockerStandaloneHost/elements/docker/install.d/56-docker b/DockerStandaloneHost/elements/docker/install.d/56-docker index c558988..b6997ef 100755 --- a/DockerStandaloneHost/elements/docker/install.d/56-docker +++ b/DockerStandaloneHost/elements/docker/install.d/56-docker @@ -2,7 +2,22 @@ set -eu -if [ -e /etc/lsb-release ]; then +os=$(uname) +dist_name='Unknown' + +if [ "${os}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + dist_name=$(cat /etc/redhat-release |sed s/\ release.*//) + elif [ -f /etc/SuSE-release ] ; then + dist_name='SuSe' + elif [ -f /etc/lsb-release ]; then + dist=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }') + fi +fi + +dist_name=$(lowercase $dist_name) + +if [ "${dist_name}" == 'ubuntu' ]; then if [ -e /usr/lib/apt/methods/https ]; then apt-get update apt-get install apt-transport-https @@ -12,5 +27,6 @@ if [ -e /etc/lsb-release ]; then apt-get update apt-get -y install lxc-docker=1.6.2 else - yum -y install docker -fi \ No newline at end of file + install-packages curl + curl -sSL https://get.docker.com/ | sh +fi diff --git a/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker b/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker index c558988..b6997ef 100755 --- a/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker +++ b/Kubernetes/KubernetesCluster/elements/docker/install.d/56-docker @@ -2,7 +2,22 @@ set -eu -if [ -e /etc/lsb-release ]; then +os=$(uname) +dist_name='Unknown' + +if [ "${os}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + dist_name=$(cat /etc/redhat-release |sed s/\ release.*//) + elif [ -f /etc/SuSE-release ] ; then + dist_name='SuSe' + elif [ -f /etc/lsb-release ]; then + dist=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }') + fi +fi + +dist_name=$(lowercase $dist_name) + +if [ "${dist_name}" == 'ubuntu' ]; then if [ -e /usr/lib/apt/methods/https ]; then apt-get update apt-get install apt-transport-https @@ -12,5 +27,6 @@ if [ -e /etc/lsb-release ]; then apt-get update apt-get -y install lxc-docker=1.6.2 else - yum -y install docker -fi \ No newline at end of file + install-packages curl + curl -sSL https://get.docker.com/ | sh +fi