install.sh: Fix for Amazon's Linux AMI

Use /etc/os-release to determine distro

Contents of /etc/os-release on Amazon Linux AMI 2014.09:
NAME="Amazon Linux AMI"
VERSION="2014.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2014.09"
PRETTY_NAME="Amazon Linux AMI 2014.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2014.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Signed-off-by: Amit Bakshi <ambakshi@gmail.com>
Signed-off-by: Jessica Frazelle <jess@docker.com>
Upstream-commit: dbe24a048bc557d34925e5ca9f7dd99f57d1d9e1
Component: engine
This commit is contained in:
Amit Bakshi
2014-08-04 12:32:12 -07:00
committed by Jessica Frazelle
parent 92a4d745a5
commit 892128be0c

View File

@ -75,13 +75,23 @@ fi
if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then
lsb_dist='Fedora'
fi
if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then
lsb_dist="$(. /etc/os-release && echo "$NAME" | cut -d' ' -f1)"
fi
case "$lsb_dist" in
Fedora)
(
set -x
$sh_c 'sleep 3; yum -y -q install docker-io'
)
Amazon|Fedora)
if [ "$lsb_dist" = 'Amazon' ]; then
(
set -x
$sh_c 'sleep 3; yum -y -q install docker'
)
else
(
set -x
$sh_c 'sleep 3; yum -y -q install docker-io'
)
fi
if command_exists docker && [ -e /var/run/docker.sock ]; then
(
set -x