install.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # This script is meant for quick & easy install via 'curl URL-OF-SCRIPT | sh'
  3. # Original version by Jeff Lindsay <progrium@gmail.com>
  4. # Revamped by Jerome Petazzoni <jerome@dotcloud.com>
  5. #
  6. # This script canonical location is http://get.docker.io/; to update it, run:
  7. # s3cmd put -m text/x-shellscript -P install.sh s3://get.docker.io/index
  8. echo "Ensuring basic dependencies are installed..."
  9. apt-get -qq update
  10. apt-get -qq install lxc wget bsdtar
  11. echo "Looking in /proc/filesystems to see if we have AUFS support..."
  12. if grep -q aufs /proc/filesystems
  13. then
  14. echo "Found."
  15. else
  16. echo "Ahem, it looks like the current kernel does not support AUFS."
  17. echo "Let's see if we can load the AUFS module with modprobe..."
  18. if modprobe aufs
  19. then
  20. echo "Module loaded."
  21. else
  22. echo "Ahem, things didn't turn out as expected."
  23. KPKG=linux-image-extra-$(uname -r)
  24. echo "Trying to install $KPKG..."
  25. if apt-get -qq install $KPKG
  26. then
  27. echo "Installed."
  28. else
  29. echo "Oops, we couldn't install the -extra kernel."
  30. echo "Are you sure you are running a supported version of Ubuntu?"
  31. echo "Proceeding anyway, but Docker will probably NOT WORK!"
  32. fi
  33. fi
  34. fi
  35. echo "Downloading docker binary and uncompressing into /usr/local/bin..."
  36. curl -s http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz |
  37. tar -C /usr/local/bin --strip-components=1 -zxf- \
  38. docker-master/docker
  39. if [ -f /etc/init/dockerd.conf ]
  40. then
  41. echo "Upstart script already exists."
  42. else
  43. echo "Creating /etc/init/dockerd.conf..."
  44. echo "exec /usr/local/bin/docker -d" > /etc/init/dockerd.conf
  45. fi
  46. echo "Starting dockerd..."
  47. start dockerd > /dev/null
  48. echo "Done."
  49. echo