-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdocker-gen.docker.txt
43 lines (32 loc) · 3.11 KB
/
docker-gen.docker.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
┏━━━━━━━━━━━━━━━━┓
┃ DOCKER-GEN ┃
┗━━━━━━━━━━━━━━━━┛
VERSION ==> #0.7.3
GOAL ==> #Template system that generates file using Docker containers information.
#Output file can be regenerated on changes, with possible triggers.
ALTERNATIVES ==> # - dockerize: simple, only ENVVAR
# - docker-gen (preferred): many Docker info, can regenerate and fire trigger on change
INSTALLATION ==> #A docker image is available, with COMMAND ... for docker-gen ...
# - e.g. communicating with other containers using shared data volumes
docker-gen TEMPLATE_FILE #Generate OUTPUT_FILE (def: stdout) by using TEMPLATE_FILE, which is Go template:
[OUTPUT_FILE] # - using as data OBJ_ARR:
# - OBJ (one for each container): ID, Addresses OBJ_ARR, Networks OBJ_ARR, Gateway, Name, Hostname, Image OBJ, Env OBJ, Volumes OBJ_ARR,
# Mounts OBJ_ARR, Node OBJ (Swarm mode), Labels OBJ, IP[6LinkLocal|Global], State.Running BOOL
# - OBJ_ARR.Docker: Name, NumContainers|Images, [Go|Api]Version, OperatingSystem, Architecture, CurrentContainerID
# - extra functions: closest, coalesce, contains, dict, exists, first|last, groupBy[Keys|Label], hasPrefix|Suffix, intersect, json, keys,
# parseBool, replace, sha1, split[N], trim[Prefix|Suffix], when, where[[Not]Exist|Any|All], whereLabel[Exists|DoesNotExist|ValueMatches]
#Must access dockerd HOST, e.g. if inside a container, must use e.g. read-only data volumes to dockerd socket
#Can be run inside a container, in which case OBJ_ARR.Docker.CurrentContainerID helps find current container data OBJ index
-config FILE #Use an INIT config file for defining CLI options
#See online for variable names
-endpoint HOST #Host's dockerd HOST (def: ENVVAR DOCKER_HOST, or unix:///var/run/docker.sock)
-tls* #Like docker. Can use same ENVVARs DOCKER_TLS_VERIFY
-keep-blank-lines #
-include-stopped #Include stopped containers
-only-exposed|published #Only include containers with exposed|published ports
-watch #Rerender template when data changes (listen for docker events)
-wait NUMs|m|h[:NUM2s|m|h] #Debounce -watch MIN[:MAX]
-notify ... #Fires ... on rerender
-interval NUM #Polling frequency for -notify
-notify-output #Redirects ... stdout|stderr to current terminal|process
-notify-sighup #Fires docker kill -s SIGHUP to container on rerender