docker/machine — pull request #50 by smashwilson (2014-12-08 21:14:14+00:00)
Title: Use a script to bootstrap Docker.

Rather than rely on each individual driver to bootstrap the hosts that it launches with a properly installed Docker service, it seems like it would be more manageable to centralize the install-and-configure logic in a single place.

I've started a bash script that uses https://get.docker.io and similar capability-probing logic to configure a host to act as a proper citizen with `machine`. I've been using it from a gist in the Rackspace driver as:

```go
if err := drivers.AddPublicKeyToAuthorizedHosts(d, "/.docker/authorized-keys.d"); err != nil {
return err
}

sshCmd, err := d.GetSSHCommand(`curl -sSL https://gist.githubusercontent.com/smashwilson/1a286139720a28ac6ead/raw/41d93c57ea2e86815cdfbfec42aaa696034afcc8/setup-docker.sh | /bin/bash`)
if err != nil {
return err
}
if err := sshCmd.Run(); err != nil {
log.Infof("Error while bootstrapping docker: %v", err)
log.Infof(`You'll need to log in with "machine ssh" and:`)
log.Infof(" * Install Docker if necessary")
log.Infof(" * Configure Docker to use identity auth and listen on all interfaces")
}
```

Do you think this is a useful approach?