mirror of https://github.com/docker/docs.git
tls support for vcloud air
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
f4cf4ce801
commit
35e0351889
|
@ -25,7 +25,6 @@ import (
|
||||||
_ "github.com/docker/machine/drivers/vmwarefusion"
|
_ "github.com/docker/machine/drivers/vmwarefusion"
|
||||||
_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
||||||
_ "github.com/docker/machine/drivers/vmwarevsphere"
|
_ "github.com/docker/machine/drivers/vmwarevsphere"
|
||||||
|
|
||||||
//_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
//_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
||||||
//_ "github.com/docker/machine/drivers/vmwarevsphere"
|
//_ "github.com/docker/machine/drivers/vmwarevsphere"
|
||||||
"github.com/docker/machine/state"
|
"github.com/docker/machine/state"
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/vmware/govcloudair"
|
"github.com/vmware/govcloudair"
|
||||||
|
@ -43,6 +42,8 @@ type Driver struct {
|
||||||
Provision bool
|
Provision bool
|
||||||
CPUCount int
|
CPUCount int
|
||||||
MemorySize int
|
MemorySize int
|
||||||
|
CaCertPath string
|
||||||
|
PrivateKeyPath string
|
||||||
|
|
||||||
VAppID string
|
VAppID string
|
||||||
storePath string
|
storePath string
|
||||||
|
@ -159,8 +160,8 @@ func GetCreateFlags() []cli.Flag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDriver(machineName string, storePath string) (drivers.Driver, error) {
|
func NewDriver(machineName string, storePath string, caCert string, privateKey string) (drivers.Driver, error) {
|
||||||
driver := &Driver{MachineName: machineName, storePath: storePath}
|
driver := &Driver{MachineName: machineName, storePath: storePath, CaCertPath: caCert, PrivateKeyPath: privateKey}
|
||||||
return driver, nil
|
return driver, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +230,7 @@ func (d *Driver) GetState() (state.State, error) {
|
||||||
return state.Error, err
|
return state.Error, err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Connecting to vCloud Air to fetch vApp Status...")
|
log.Debug("Connecting to vCloud Air to fetch vApp Status...")
|
||||||
// Authenticate to vCloud Air
|
// Authenticate to vCloud Air
|
||||||
v, err := p.Authenticate(d.UserName, d.UserPassword, d.ComputeID, d.VDCID)
|
v, err := p.Authenticate(d.UserName, d.UserPassword, d.ComputeID, d.VDCID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -426,52 +427,6 @@ func (d *Driver) Create() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Stopping Docker")
|
|
||||||
|
|
||||||
cmd, err = d.GetSSHCommand("stop docker")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := cmd.Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("Replacing docker binary with a version that supports identity authentication")
|
|
||||||
cmd, err = d.GetSSHCommand("curl -sS https://bfirsh.s3.amazonaws.com/docker/docker-1.3.1-dev-identity-auth > /usr/bin/docker")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := cmd.Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
dockerListen := "echo 'export DOCKER_OPTS=\"--auth=identity --host=tcp://0.0.0.0:" + strconv.Itoa(d.DockerPort) + "\"' >> /etc/default/docker"
|
|
||||||
|
|
||||||
log.Infof("Updating /etc/default/docker to listen on all interfaces...")
|
|
||||||
|
|
||||||
cmd, err = d.GetSSHCommand(dockerListen)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = cmd.Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("Adding key to authorized-keys.d...")
|
|
||||||
|
|
||||||
if err := drivers.AddPublicKeyToAuthorizedHosts(d, "/.docker/authorized-keys.d"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd, err = d.GetSSHCommand("start docker")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := cmd.Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("Disconnecting from vCloud Air...")
|
log.Debugf("Disconnecting from vCloud Air...")
|
||||||
|
|
Loading…
Reference in New Issue