2013-03-11 22:03:22 -04:00
|
|
|
#!/bin/sh
|
2013-03-12 02:13:08 -04:00
|
|
|
# This script is meant for quick & easy install via 'curl URL-OF-SCRIPT | sh'
|
2013-03-12 02:37:38 -04:00
|
|
|
# Original version by Jeff Lindsay <progrium@gmail.com>
|
|
|
|
# Revamped by Jerome Petazzoni <jerome@dotcloud.com>
|
|
|
|
#
|
2013-08-08 20:02:59 -04:00
|
|
|
# This script canonical location is https://get.docker.io/; to update it, run:
|
2013-03-12 02:37:38 -04:00
|
|
|
# s3cmd put -m text/x-shellscript -P install.sh s3://get.docker.io/index
|
2013-02-25 15:27:29 -05:00
|
|
|
|
2013-03-12 02:09:19 -04:00
|
|
|
echo "Ensuring basic dependencies are installed..."
|
|
|
|
apt-get -qq update
|
2013-06-18 13:23:45 -04:00
|
|
|
apt-get -qq install lxc wget
|
2013-03-12 02:09:19 -04:00
|
|
|
|
|
|
|
echo "Looking in /proc/filesystems to see if we have AUFS support..."
|
|
|
|
if grep -q aufs /proc/filesystems
|
|
|
|
then
|
|
|
|
echo "Found."
|
|
|
|
else
|
|
|
|
echo "Ahem, it looks like the current kernel does not support AUFS."
|
|
|
|
echo "Let's see if we can load the AUFS module with modprobe..."
|
|
|
|
if modprobe aufs
|
|
|
|
then
|
|
|
|
echo "Module loaded."
|
|
|
|
else
|
|
|
|
echo "Ahem, things didn't turn out as expected."
|
|
|
|
KPKG=linux-image-extra-$(uname -r)
|
|
|
|
echo "Trying to install $KPKG..."
|
|
|
|
if apt-get -qq install $KPKG
|
|
|
|
then
|
|
|
|
echo "Installed."
|
|
|
|
else
|
|
|
|
echo "Oops, we couldn't install the -extra kernel."
|
|
|
|
echo "Are you sure you are running a supported version of Ubuntu?"
|
|
|
|
echo "Proceeding anyway, but Docker will probably NOT WORK!"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2013-02-25 15:27:29 -05:00
|
|
|
|
2013-08-14 21:35:17 -04:00
|
|
|
echo "Downloading docker binary to /usr/local/bin..."
|
|
|
|
curl -s https://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest \
|
|
|
|
> /usr/local/bin/docker
|
|
|
|
chmod +x /usr/local/bin/docker
|
2013-02-25 15:27:29 -05:00
|
|
|
|
2013-03-12 02:13:08 -04:00
|
|
|
if [ -f /etc/init/dockerd.conf ]
|
2013-02-25 15:27:29 -05:00
|
|
|
then
|
|
|
|
echo "Upstart script already exists."
|
|
|
|
else
|
|
|
|
echo "Creating /etc/init/dockerd.conf..."
|
2013-08-05 21:11:13 -04:00
|
|
|
cat >/etc/init/dockerd.conf <<EOF
|
|
|
|
description "Docker daemon"
|
|
|
|
start on filesystem or runlevel [2345]
|
|
|
|
stop on runlevel [!2345]
|
|
|
|
respawn
|
2013-08-14 21:35:17 -04:00
|
|
|
exec /usr/local/bin/docker -d
|
2013-08-05 21:11:13 -04:00
|
|
|
EOF
|
2013-02-25 15:27:29 -05:00
|
|
|
fi
|
|
|
|
|
2013-03-12 02:08:21 -04:00
|
|
|
echo "Starting dockerd..."
|
|
|
|
start dockerd > /dev/null
|
2013-02-25 15:27:29 -05:00
|
|
|
|
2013-03-12 02:37:38 -04:00
|
|
|
echo "Done."
|
2013-02-25 15:27:29 -05:00
|
|
|
echo
|