mirror of https://github.com/docker/docs.git
Merge pull request #53 from jpetazzo/cloudinit
Rework install.sh to work with cloud-init
This commit is contained in:
commit
47c86e7fd9
63
install.sh
63
install.sh
|
@ -1,20 +1,46 @@
|
||||||
# This script is meant for quick & easy install via 'curl URL-OF-SCRIPPT | bash'
|
#!/bin/sh
|
||||||
# Courtesy of Jeff Lindsay <progrium@gmail.com>
|
# This script is meant for quick & easy install via 'curl URL-OF-SCRIPT | sh'
|
||||||
|
# Original version by Jeff Lindsay <progrium@gmail.com>
|
||||||
|
# Revamped by Jerome Petazzoni <jerome@dotcloud.com>
|
||||||
|
#
|
||||||
|
# This script canonical location is http://get.docker.io/; to update it, run:
|
||||||
|
# s3cmd put -m text/x-shellscript -P install.sh s3://get.docker.io/index
|
||||||
|
|
||||||
cd /tmp
|
echo "Ensuring basic dependencies are installed..."
|
||||||
|
apt-get -qq update
|
||||||
|
apt-get -qq install lxc wget bsdtar
|
||||||
|
|
||||||
echo "Ensuring dependencies are installed..."
|
echo "Looking in /proc/filesystems to see if we have AUFS support..."
|
||||||
apt-get --yes install lxc wget bsdtar 2>&1 > /dev/null
|
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
|
||||||
|
|
||||||
echo "Downloading docker binary..."
|
echo "Downloading docker binary and uncompressing into /usr/local/bin..."
|
||||||
wget -q https://dl.dropbox.com/u/20637798/docker.tar.gz 2>&1 > /dev/null
|
curl -s http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz |
|
||||||
tar -xf docker.tar.gz 2>&1 > /dev/null
|
tar -C /usr/local/bin --strip-components=1 -zxf- \
|
||||||
|
docker-master/docker docker-master/dockerd
|
||||||
|
|
||||||
echo "Installing into /usr/local/bin..."
|
if [ -f /etc/init/dockerd.conf ]
|
||||||
mv docker/docker /usr/local/bin
|
|
||||||
mv dockerd/dockerd /usr/local/bin
|
|
||||||
|
|
||||||
if [[ -f /etc/init/dockerd.conf ]]
|
|
||||||
then
|
then
|
||||||
echo "Upstart script already exists."
|
echo "Upstart script already exists."
|
||||||
else
|
else
|
||||||
|
@ -22,13 +48,8 @@ else
|
||||||
echo "exec /usr/local/bin/dockerd" > /etc/init/dockerd.conf
|
echo "exec /usr/local/bin/dockerd" > /etc/init/dockerd.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Restarting dockerd..."
|
echo "Starting dockerd..."
|
||||||
restart dockerd > /dev/null
|
start dockerd > /dev/null
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Done."
|
||||||
rmdir docker
|
|
||||||
rmdir dockerd
|
|
||||||
rm docker.tar.gz
|
|
||||||
|
|
||||||
echo "Finished!"
|
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue