Skip to content

Commit 1150ac0

Browse files
committed
Merge pull request #23 from QuentinPerez/add-image
Add image
2 parents 139ee38 + 4e55bae commit 1150ac0

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,23 @@ Description:
4242

4343
Options:
4444

45-
--driver, -d "none" Driver to create machine with.
45+
--driver, -d "none" Driver to create machine with. [$MACHINE_DRIVER]
4646
--engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine
4747
--engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine
4848
--engine-install-url "https://get.docker.com" Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]
4949
--engine-label [--engine-label option --engine-label option] Specify labels for the created engine
5050
--engine-opt [--engine-opt option --engine-opt option] Specify arbitrary flags to include with the created engine in the form flag=value
51-
--engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use
51+
--engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]
5252
--engine-storage-driver Specify a storage driver to use with the engine
5353
--scaleway-commercial-type "VC1S" Specifies the commercial type [$SCALEWAY_COMMERCIAL_TYPE]
54+
--scaleway-image "ubuntu-trusty" Specifies the image [$SCALEWAY_IMAGE]
5455
--scaleway-name Assign a name [$SCALEWAY_NAME]
5556
--scaleway-organization Scaleway organization [$SCALEWAY_ORGANIZATION]
5657
--scaleway-token Scaleway token [$SCALEWAY_TOKEN]
5758
--swarm Configure Machine with Swarm
5859
--swarm-addr addr to advertise for Swarm (default: detect and use the machine IP)
5960
--swarm-discovery Discovery service to use with Swarm
61+
--swarm-experimental Enable Swarm experimental features
6062
--swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master
6163
--swarm-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]
6264
--swarm-master Configure Machine to be a Swarm master
@@ -115,11 +117,11 @@ $> curl --silent http://212.47.248.251 | head -n1 # you can also open your brows
115117

116118
## Options
117119

118-
|Option Name |Description |Default Value|required|
119-
|--------------------------------------------------------------|-------------------|-------------|--------|
120-
|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes |
121-
|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes |
122-
|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no |
120+
|Option Name |Description |Default Value|required|
121+
|----------------------------------------------------------------|-------------------|-------------|--------|
122+
|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes |
123+
|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes |
124+
|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no |
123125
|``--scaleway-commercial-type`` or ``$SCALEWAY_COMMERCIAL_TYPE`` |Commercial type |VC1S |no |
124126

125127
---
@@ -128,7 +130,7 @@ $> curl --silent http://212.47.248.251 | head -n1 # you can also open your brows
128130

129131
### master (unreleased)
130132

131-
* No entry
133+
* Add `--scaleway-image` ([#22](https://github.com/scaleway/docker-machine-driver-scaleway/issues/22)
132134

133135
View full [commits list](https://github.com/scaleway/docker-machine-driver-scaleway/compare/v1.0.2...master)
134136

driver/scaleway.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Driver struct {
3535
Token string
3636
commercialType string
3737
name string
38+
image string
3839
stopping bool
3940
// size string
4041
// userDataFile string
@@ -72,6 +73,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) {
7273
}
7374
d.commercialType = flags.String("scaleway-commercial-type")
7475
d.name = flags.String("scaleway-name")
76+
d.image = flags.String("scaleway-image")
7577
return
7678
}
7779

@@ -106,6 +108,12 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
106108
Usage: "Specifies the commercial type",
107109
Value: "VC1S",
108110
},
111+
mcnflag.StringFlag{
112+
EnvVar: "SCALEWAY_IMAGE",
113+
Name: "scaleway-image",
114+
Usage: "Specifies the image",
115+
Value: defaultImage,
116+
},
109117
// mcnflag.StringFlag{
110118
// EnvVar: "SCALEWAY_USERDATA",
111119
// Name: "scaleway-userdata",
@@ -145,7 +153,7 @@ func (d *Driver) Create() (err error) {
145153
d.IPAddress = ip.IP.Address
146154
d.IPID = ip.IP.ID
147155
d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{
148-
ImageName: defaultImage,
156+
ImageName: d.image,
149157
CommercialType: d.commercialType,
150158
Name: d.name,
151159
Bootscript: defaultBootscript,

0 commit comments

Comments
 (0)