summaryrefslogtreecommitdiff
path: root/hack/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hack/install.sh')
-rwxr-xr-xhack/install.sh47
1 files changed, 37 insertions, 10 deletions
diff --git a/hack/install.sh b/hack/install.sh
index 65e34f9659..43248cf2c0 100755
--- a/hack/install.sh
+++ b/hack/install.sh
@@ -72,11 +72,38 @@ fi
if [ -z "$lsb_dist" ] && [ -r /etc/debian_version ]; then
lsb_dist='Debian'
fi
+if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then
+ lsb_dist='Fedora'
+fi
case "$lsb_dist" in
+ Fedora)
+ (
+ set -x
+ $sh_c 'sleep 3; yum -y -q install docker-io'
+ )
+ if command_exists docker && [ -e /var/run/docker.sock ]; then
+ (
+ set -x
+ $sh_c 'docker run busybox echo "Docker has been successfully installed!"'
+ ) || true
+ fi
+ your_user=your-user
+ [ "$user" != 'root' ] && your_user="$user"
+ echo
+ echo 'If you would like to use Docker as a non-root user, you should now consider'
+ echo 'adding your user to the "docker" group with something like:'
+ echo
+ echo ' sudo usermod -aG docker' $your_user
+ echo
+ echo 'Remember that you will have to log out and back in for this to take effect!'
+ echo
+ exit 0
+ ;;
+
Ubuntu|Debian)
export DEBIAN_FRONTEND=noninteractive
-
+
did_apt_get_update=
apt_get_update() {
if [ -z "$did_apt_get_update" ]; then
@@ -84,21 +111,21 @@ case "$lsb_dist" in
did_apt_get_update=1
fi
}
-
- # TODO remove this section once device-mapper lands
+
+ # aufs is preferred over devicemapper; try to ensure the driver is available.
if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then
kern_extras="linux-image-extra-$(uname -r)"
-
+
apt_get_update
( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true
-
+
if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then
echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)'
echo >&2 ' but we still have no AUFS. Docker may not work. Proceeding anyways!'
( set -x; sleep 10 )
fi
fi
-
+
if [ ! -e /usr/lib/apt/methods/https ]; then
apt_get_update
( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https' )
@@ -111,9 +138,9 @@ case "$lsb_dist" in
(
set -x
if [ "https://get.docker.io/" = "$url" ]; then
- $sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9"
+ $sh_c "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9"
elif [ "https://test.docker.io/" = "$url" ]; then
- $sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 740B314AE3941731B942C66ADF4FD13717AAD7D6"
+ $sh_c "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 740B314AE3941731B942C66ADF4FD13717AAD7D6"
else
$sh_c "$curl ${url}gpg | apt-key add -"
fi
@@ -138,7 +165,7 @@ case "$lsb_dist" in
echo
exit 0
;;
-
+
Gentoo)
if [ "$url" = "https://test.docker.io/" ]; then
echo >&2
@@ -153,7 +180,7 @@ case "$lsb_dist" in
echo >&2
exit 1
fi
-
+
(
set -x
$sh_c 'sleep 3; emerge app-emulation/docker'