@@ -151,7 +151,21 @@ func (r *RuntimeContainer) PublishedAddresses() []Address {
151
151
}
152
152
153
153
func usage () {
154
- println ("Usage: docker-gen [-config file] [-watch=false] [-notify=\" restart xyz\" ] [-notify-sighup=\" container-ID\" ] [-interval=0] [-endpoint tcp|unix://..] [-tlscert file] [-tlskey file] [-tlscacert file] [-tlsverify] <template> [<dest>]" )
154
+ println (`Usage: docker-gen [options] template [dest]
155
+
156
+ Generate files from docker container meta-data
157
+
158
+ Options:` )
159
+ flag .PrintDefaults ()
160
+
161
+ println (`
162
+ Arguments:
163
+ template - path to a template to generate
164
+ dest - path to a write the template. If not specfied, STDOUT is used
165
+
166
+ Environment Variables:
167
+ DOCKER_HOST - default value for -endpoint
168
+ ` )
155
169
}
156
170
157
171
func NewDockerClient (endpoint string ) (* docker.Client , error ) {
@@ -349,16 +363,20 @@ func initFlags() {
349
363
flag .BoolVar (& version , "version" , false , "show version" )
350
364
flag .BoolVar (& watch , "watch" , false , "watch for container changes" )
351
365
flag .BoolVar (& onlyExposed , "only-exposed" , false , "only include containers with exposed ports" )
352
- flag .BoolVar (& onlyPublished , "only-published" , false , "only include containers with published ports (implies -only-exposed)" )
353
- flag .StringVar (& notifyCmd , "notify" , "" , "run command after template is regenerated" )
354
- flag .StringVar (& notifySigHUPContainerID , "notify-sighup" , "" , "send HUP signal to container. Equivalent to `docker kill -s HUP container-ID`" )
366
+
367
+ flag .BoolVar (& onlyPublished , "only-published" , false ,
368
+ "only include containers with published ports (implies -only-exposed)" )
369
+ flag .StringVar (& notifyCmd , "notify" , "" , "run command after template is regenerated (e.g `restart xyz`)" )
370
+ flag .StringVar (& notifySigHUPContainerID , "notify-sighup" , "" ,
371
+ "send HUP signal to container. Equivalent to `docker kill -s HUP container-ID`" )
355
372
flag .Var (& configFiles , "config" , "config files with template directives. Config files will be merged if this option is specified multiple times." )
356
- flag .IntVar (& interval , "interval" , 0 , "notify command interval (s )" )
357
- flag .StringVar (& endpoint , "endpoint" , "" , "docker api endpoint" )
373
+ flag .IntVar (& interval , "interval" , 0 , "notify command interval (secs )" )
374
+ flag .StringVar (& endpoint , "endpoint" , "" , "docker api endpoint (tcp|unix://..). Default unix:///var/run/docker.sock " )
358
375
flag .StringVar (& tlsCert , "tlscert" , "" , "path to TLS client certificate file" )
359
376
flag .StringVar (& tlsKey , "tlskey" , "" , "path to TLS client key file" )
360
377
flag .StringVar (& tlsCaCert , "tlscacert" , "" , "path to TLS CA certificate file" )
361
378
flag .BoolVar (& tlsVerify , "tlsverify" , false , "verify docker daemon's TLS certicate" )
379
+ flag .Usage = usage
362
380
flag .Parse ()
363
381
}
364
382
0 commit comments