mirror of https://github.com/docker/docs.git
Add flag --openstack-docker-install
Boolean flag to indicate if docker have to be installed on the machine. Useful when docker is already installed and configured in the OpenStack image. Default set to `true` Signed-off-by: Guillaume Giamarchi <guillaume.giamarchi@gmail.com>
This commit is contained in:
parent
a2d64fe5c0
commit
2332bcc9d8
|
@ -203,6 +203,8 @@ Options:
|
||||||
there is no IP address already allocated a new IP will be allocated and assigned to the machine.
|
there is no IP address already allocated a new IP will be allocated and assigned to the machine.
|
||||||
- `--openstack-ssh-user`: The username to use for SSH into the machine. If not provided `root` will be used.
|
- `--openstack-ssh-user`: The username to use for SSH into the machine. If not provided `root` will be used.
|
||||||
- `--openstack-ssh-port`: Customize the SSH port if the SSH server on the machine does not listen on the default port.
|
- `--openstack-ssh-port`: Customize the SSH port if the SSH server on the machine does not listen on the default port.
|
||||||
|
- `--openstack-docker-install`: Boolean flag to indicate if docker have to be installed on the machine. Useful when
|
||||||
|
docker is already installed and configured in the OpenStack image. Default set to `true`
|
||||||
|
|
||||||
Environment variables:
|
Environment variables:
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ type Driver struct {
|
||||||
SSHPort int
|
SSHPort int
|
||||||
Ip string
|
Ip string
|
||||||
storePath string
|
storePath string
|
||||||
|
installDocher bool
|
||||||
client Client
|
client Client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +166,13 @@ func GetCreateFlags() []cli.Flag {
|
||||||
Usage: "OpenStack SSH port",
|
Usage: "OpenStack SSH port",
|
||||||
Value: 22,
|
Value: 22,
|
||||||
},
|
},
|
||||||
|
// Using a StringFlag rather than a BoolFlag because
|
||||||
|
// the BoolFlag default value is always false
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "openstack-docker-install",
|
||||||
|
Usage: "Set if docker have to be installed on the machine",
|
||||||
|
Value: "true",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +215,12 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
|
||||||
d.FloatingIpPool = flags.String("openstack-floatingip-pool")
|
d.FloatingIpPool = flags.String("openstack-floatingip-pool")
|
||||||
d.SSHUser = flags.String("openstack-ssh-user")
|
d.SSHUser = flags.String("openstack-ssh-user")
|
||||||
d.SSHPort = flags.Int("openstack-ssh-port")
|
d.SSHPort = flags.Int("openstack-ssh-port")
|
||||||
|
|
||||||
|
installDocker, err := strconv.ParseBool(flags.String("openstack-docker-install"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
d.installDocher = installDocker
|
||||||
return d.checkConfig()
|
return d.checkConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,8 +330,10 @@ func (d *Driver) Create() error {
|
||||||
if err := d.waitForSSHServer(); err != nil {
|
if err := d.waitForSSHServer(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := d.installDocker(); err != nil {
|
if d.installDocher {
|
||||||
return err
|
if err := d.installDocker(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue