dotcloud/docker — pull request #2037 by tianon (2013-09-28 12:13:50+00:00)
Title: Revamp install.sh to be usable by more people, and to use official install methods whenever possible (apt repo, portage tree, etc.)

I've revamped `install.sh` as per discussion in #1978 and on IRC. Consider this an official solicitation for comments (cc @shykes). :)

Currently, it will only detect Ubuntu and Gentoo, but that will be expanded in the future. I've intentionally kept the syntax to POSIX instead of bash to make sure we can cover as much ground as possible in the future with this one script, and especially so that we don't get errors from `curl https://get.docker.io | sh` in Ubuntu where Dash is the default `/bin/sh` provider.

Here's how I've been testing the Ubuntu portion of the script: (I found that it wouldn't install at all on 12.04, and gave a very cryptic error message about dependancies not being met but not listing any that weren't being met, so that's why I'm explicitly using 12.10 here.)
```bash
cat contrib/install.sh | docker run -i -privileged ubuntu:12.10 sh -c
'echo "#!/bin/sh" > /usr/sbin/policy-rc.d; echo exit 101 >> /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d; dpkg-divert --local --rename --add /sbin/initctl; ln -s /bin/true /sbin/initctl; sh'
```

If someone has access to an EC2 account and wouldn't mind testing Ubuntu's CloudInit with the following line, that would be extremely helpful, since that's a huge use of this script (http://docs.docker.io/en/master/installation/amazon/#amazonquickstart), but I don't have access to an EC2 account I can test this on. When you get to the part of adding the User Data, use the following line to make sure you get my proposed changes:
```
#include https://raw.github.com/tianon/docker/install-script-revamp/contrib/install.sh
```

After/If we can agree on the basics that I've proposed here, then I'll add Arch and eventually Debian, when our package gets into the archives (are we going to add a debian repo to get.docker.io / test.docker.io, @mzdaniel?).

@metalivedev I've also updated the `amazon.rst` doc that mentioned `dockerd` from the old script, especially since the `.deb` automatically creates the `docker` group for you, so the language change was even simpler.