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/vmwarevcloudair"
|
||||
_ "github.com/docker/machine/drivers/vmwarevsphere"
|
||||
|
||||
//_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
||||
//_ "github.com/docker/machine/drivers/vmwarevsphere"
|
||||
"github.com/docker/machine/state"
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/vmware/govcloudair"
|
||||
|
@ -28,21 +27,23 @@ const (
|
|||
)
|
||||
|
||||
type Driver struct {
|
||||
UserName string
|
||||
UserPassword string
|
||||
ComputeID string
|
||||
VDCID string
|
||||
OrgVDCNet string
|
||||
EdgeGateway string
|
||||
PublicIP string
|
||||
Catalog string
|
||||
CatalogItem string
|
||||
MachineName string
|
||||
SSHPort int
|
||||
DockerPort int
|
||||
Provision bool
|
||||
CPUCount int
|
||||
MemorySize int
|
||||
UserName string
|
||||
UserPassword string
|
||||
ComputeID string
|
||||
VDCID string
|
||||
OrgVDCNet string
|
||||
EdgeGateway string
|
||||
PublicIP string
|
||||
Catalog string
|
||||
CatalogItem string
|
||||
MachineName string
|
||||
SSHPort int
|
||||
DockerPort int
|
||||
Provision bool
|
||||
CPUCount int
|
||||
MemorySize int
|
||||
CaCertPath string
|
||||
PrivateKeyPath string
|
||||
|
||||
VAppID string
|
||||
storePath string
|
||||
|
@ -159,8 +160,8 @@ func GetCreateFlags() []cli.Flag {
|
|||
}
|
||||
}
|
||||
|
||||
func NewDriver(machineName string, storePath string) (drivers.Driver, error) {
|
||||
driver := &Driver{MachineName: machineName, storePath: storePath}
|
||||
func NewDriver(machineName string, storePath string, caCert string, privateKey string) (drivers.Driver, error) {
|
||||
driver := &Driver{MachineName: machineName, storePath: storePath, CaCertPath: caCert, PrivateKeyPath: privateKey}
|
||||
return driver, nil
|
||||
}
|
||||
|
||||
|
@ -229,7 +230,7 @@ func (d *Driver) GetState() (state.State, error) {
|
|||
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
|
||||
v, err := p.Authenticate(d.UserName, d.UserPassword, d.ComputeID, d.VDCID)
|
||||
if err != nil {
|
||||
|
@ -426,52 +427,6 @@ func (d *Driver) Create() error {
|
|||
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...")
|
||||
|
|
Loading…
Reference in New Issue