Compare commits

...

7 Commits

Author SHA1 Message Date
Evan Hazlett
8b9eaf2b6f Merge pull request #953 from ehazlett/bump_0.2.0
Bump 0.2.0
2015-04-16 00:26:39 -04:00
Nathan LeClaire
f1c04ff277 Add section on how to get help to docs
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-10 16:17:22 -04:00
Dave Henderson
b8d1e022df Adding quotes to the suggested eval
Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
2015-04-09 11:25:43 -04:00
Guillaume Giamarchi
76d349fefb Fix documentation typo
Fix #983

Signed-off-by: Guillaume Giamarchi <guillaume.giamarchi@gmail.com>
2015-04-09 11:23:04 -04:00
Nathan LeClaire
c742426ce1 Add a few improvements to stability
This improves on a few issues which are not frequent but do sometimes
come up:

1. Check that the daemon is up before attempting to do anything
   docker-ey in provisioning Ubuntu
2. Set a max retries for SSH so that if a request fails it attempts
   again before giving up

Also have annotated a few of the SSH options slightly better.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-07 11:31:26 -04:00
Evan Hazlett
899bfa9d77 digitalocean: remove unneeded wait for ssh
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-04-03 17:43:05 -04:00
Evan Hazlett
48bea37d09 Merge remote-tracking branch 'origin/master' into bump_0.2.0 2015-04-01 15:59:18 -04:00
5 changed files with 43 additions and 11 deletions

View File

@@ -750,9 +750,9 @@ func generateUsageHint(machineName string, userShell string) string {
}
default:
if machineName != "" {
cmd = fmt.Sprintf("eval $(docker-machine env %s)", machineName)
cmd = fmt.Sprintf("eval \"$(docker-machine env %s)\"", machineName)
} else {
cmd = "eval $(docker-machine env)"
cmd = "eval \"$(docker-machine env)\""
}
}

View File

@@ -21,6 +21,22 @@ managing them:
- Upgrading Docker
- Configuring the Docker client to talk to your host
## Getting help
Docker Machine is still in its infancy and under active development. If you need
help, would like to contribute, or simply want to talk about to the project with
like-minded individuals, we have a number of open channels for communication.
- To report bugs or file feature requests: please use the [issue tracker on
Github](https://github.com/docker/machine/issues).
- To talk about the project with people in real time: please join the
`#docker-machine` channel on IRC.
- To contribute code or documentation changes: please [submit a pull request on
Github](https://github.com/docker/machine/pulls).
For more information and resources, please visit
[https://docs.docker.com/project/get-help/](https://docs.docker.com/project/get-help/).
## Installation
Docker Machine is supported on Windows, OSX, and Linux. To install Docker
@@ -820,7 +836,7 @@ variable and CLI option are provided the CLI option takes the precedence.
| Environment variable | CLI option |
|----------------------|-----------------------------|
| `OS_USERNAME` | `--rackspace-username` |
| `OS_API_KEY` | `--rackspace-ap-key` |
| `OS_API_KEY` | `--rackspace-api-key` |
| `OS_REGION_NAME` | `--rackspace-region` |
| `OS_ENDPOINT_TYPE` | `--rackspace-endpoint-type` |

View File

@@ -234,12 +234,6 @@ func (d *Driver) Create() error {
newDroplet.Droplet.ID,
d.IPAddress)
log.Infof("Waiting for SSH...")
if err := ssh.WaitForTCP(fmt.Sprintf("%s:%d", d.IPAddress, 22)); err != nil {
return err
}
return nil
}

View File

@@ -5,10 +5,12 @@ import (
"fmt"
"os/exec"
log "github.com/Sirupsen/logrus"
"github.com/docker/machine/drivers"
"github.com/docker/machine/libmachine/auth"
"github.com/docker/machine/libmachine/provision/pkgaction"
"github.com/docker/machine/libmachine/swarm"
"github.com/docker/machine/utils"
)
func init() {
@@ -80,6 +82,21 @@ func (provisioner *UbuntuProvisioner) Package(name string, action pkgaction.Pack
return nil
}
func (provisioner *UbuntuProvisioner) dockerDaemonResponding() bool {
cmd, err := provisioner.SSHCommand("sudo docker version")
if err != nil {
log.Warn("Error getting SSH command to check if the daemon is up: %s", err)
return false
}
if err := cmd.Run(); err != nil {
log.Debug("Error checking for daemon up: %s", err)
return false
}
// The daemon is up if the command worked. Carry on.
return true
}
func (provisioner *UbuntuProvisioner) Provision(swarmOptions swarm.SwarmOptions, authOptions auth.AuthOptions) error {
if err := provisioner.SetHostname(provisioner.Driver.GetMachineName()); err != nil {
return err
@@ -95,6 +112,10 @@ func (provisioner *UbuntuProvisioner) Provision(swarmOptions swarm.SwarmOptions,
return err
}
if err := utils.WaitFor(provisioner.dockerDaemonResponding); err != nil {
return err
}
if err := ConfigureAuth(provisioner, authOptions); err != nil {
return err
}

View File

@@ -13,8 +13,9 @@ import (
func GetSSHCommand(host string, port int, user string, sshKey string, args ...string) *exec.Cmd {
defaultSSHArgs := []string{
"-o", "IdentitiesOnly=yes",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no", // don't bother checking in ~/.ssh/known_hosts
"-o", "UserKnownHostsFile=/dev/null", // don't write anything to ~/.ssh/known_hosts
"-o", "ConnectionAttempts=30", // retry 30 times if SSH connection fails
"-o", "LogLevel=quiet", // suppress "Warning: Permanently added '[localhost]:2022' (ECDSA) to the list of known hosts."
"-p", fmt.Sprintf("%d", port),
"-i", sshKey,