|
| 1 | +Docker stuff |
| 2 | +============ |
| 3 | + |
| 4 | +.. _docker: |
| 5 | + |
| 6 | +Values returned by docker module |
| 7 | +-------------------------------- |
| 8 | + |
| 9 | +The Docker module sets facts, so there's no need to use `register` in order to |
| 10 | +access these variables. Instead, just access the `docker_containers` variable, |
| 11 | +which is a list that looks like this: |
| 12 | + |
| 13 | +``` |
| 14 | +"docker_containers": [ |
| 15 | + { |
| 16 | + "AppArmorProfile": "", |
| 17 | + "Args": [ |
| 18 | + "postgres" |
| 19 | + ], |
| 20 | + "Config": { |
| 21 | + "AttachStderr": false, |
| 22 | + "AttachStdin": false, |
| 23 | + "AttachStdout": false, |
| 24 | + "Cmd": [ |
| 25 | + "postgres" |
| 26 | + ], |
| 27 | + "CpuShares": 0, |
| 28 | + "Cpuset": "", |
| 29 | + "Domainname": "", |
| 30 | + "Entrypoint": [ |
| 31 | + "/docker-entrypoint.sh" |
| 32 | + ], |
| 33 | + "Env": [ |
| 34 | + "POSTGRES_PASSWORD=password", |
| 35 | + "POSTGRES_USER=mezzanine", |
| 36 | + "PATH=/usr/lib/postgresql/9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", |
| 37 | + "LANG=en_US.utf8", |
| 38 | + "PG_MAJOR=9.4", |
| 39 | + "PG_VERSION=9.4.0-1.pgdg70+1", |
| 40 | + "PGDATA=/var/lib/postgresql/data" |
| 41 | + ], |
| 42 | + "ExposedPorts": { |
| 43 | + "5432/tcp": {} |
| 44 | + }, |
| 45 | + "Hostname": "71f40ec4b58c", |
| 46 | + "Image": "postgres", |
| 47 | + "MacAddress": "", |
| 48 | + "Memory": 0, |
| 49 | + "MemorySwap": 0, |
| 50 | + "NetworkDisabled": false, |
| 51 | + "OnBuild": null, |
| 52 | + "OpenStdin": false, |
| 53 | + "PortSpecs": null, |
| 54 | + "StdinOnce": false, |
| 55 | + "Tty": false, |
| 56 | + "User": "", |
| 57 | + "Volumes": { |
| 58 | + "/var/lib/postgresql/data": {} |
| 59 | + }, |
| 60 | + "WorkingDir": "" |
| 61 | + }, |
| 62 | + "Created": "2014-12-25T22:59:15.841107151Z", |
| 63 | + "Driver": "aufs", |
| 64 | + "ExecDriver": "native-0.2", |
| 65 | + "HostConfig": { |
| 66 | + "Binds": null, |
| 67 | + "CapAdd": null, |
| 68 | + "CapDrop": null, |
| 69 | + "ContainerIDFile": "", |
| 70 | + "Devices": null, |
| 71 | + "Dns": null, |
| 72 | + "DnsSearch": null, |
| 73 | + "ExtraHosts": null, |
| 74 | + "IpcMode": "", |
| 75 | + "Links": null, |
| 76 | + "LxcConf": null, |
| 77 | + "NetworkMode": "", |
| 78 | + "PortBindings": { |
| 79 | + "5432/tcp": [ |
| 80 | + { |
| 81 | + "HostIp": "0.0.0.0", |
| 82 | + "HostPort": "" |
| 83 | + } |
| 84 | + ] |
| 85 | + }, |
| 86 | + "Privileged": false, |
| 87 | + "PublishAllPorts": false, |
| 88 | + "RestartPolicy": { |
| 89 | + "MaximumRetryCount": 0, |
| 90 | + "Name": "" |
| 91 | + }, |
| 92 | + "SecurityOpt": null, |
| 93 | + "VolumesFrom": [ |
| 94 | + "data-volume" |
| 95 | + ] |
| 96 | + }, |
| 97 | + "HostnamePath": "/mnt/sda1/var/lib/docker/containers/71f40ec4b58c3176030274afb025fbd3eb130fe79d4a6a69de473096f335e7eb/hostname", |
| 98 | + "HostsPath": "/mnt/sda1/var/lib/docker/containers/71f40ec4b58c3176030274afb025fbd3eb130fe79d4a6a69de473096f335e7eb/hosts", |
| 99 | + "Id": "71f40ec4b58c3176030274afb025fbd3eb130fe79d4a6a69de473096f335e7eb", |
| 100 | + "Image": "b58a816df10fb20c956d39724001d4f2fabddec50e0d9099510f0eb579ec8a45", |
| 101 | + "MountLabel": "", |
| 102 | + "Name": "/high_lovelace", |
| 103 | + "NetworkSettings": { |
| 104 | + "Bridge": "docker0", |
| 105 | + "Gateway": "172.17.42.1", |
| 106 | + "IPAddress": "172.17.0.12", |
| 107 | + "IPPrefixLen": 16, |
| 108 | + "MacAddress": "02:42:ac:11:00:0c", |
| 109 | + "PortMapping": null, |
| 110 | + "Ports": { |
| 111 | + "5432/tcp": [ |
| 112 | + { |
| 113 | + "HostIp": "0.0.0.0", |
| 114 | + "HostPort": "49153" |
| 115 | + } |
| 116 | + ] |
| 117 | + } |
| 118 | + }, |
| 119 | + "Path": "/docker-entrypoint.sh", |
| 120 | + "ProcessLabel": "", |
| 121 | + "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/71f40ec4b58c3176030274afb025fbd3eb130fe79d4a6a69de473096f335e7eb/resolv.conf", |
| 122 | + "State": { |
| 123 | + "Error": "", |
| 124 | + "ExitCode": 0, |
| 125 | + "FinishedAt": "0001-01-01T00:00:00Z", |
| 126 | + "OOMKilled": false, |
| 127 | + "Paused": false, |
| 128 | + "Pid": 9625, |
| 129 | + "Restarting": false, |
| 130 | + "Running": true, |
| 131 | + "StartedAt": "2014-12-25T22:59:16.219732465Z" |
| 132 | + }, |
| 133 | + "Volumes": { |
| 134 | + "/var/lib/postgresql/data": "/mnt/sda1/var/lib/docker/vfs/dir/4ccd3150c8d74b9b0feb56df928ac915599e12c3ab573cd4738a18fe3dc6f474" |
| 135 | + }, |
| 136 | + "VolumesRW": { |
| 137 | + "/var/lib/postgresql/data": true |
| 138 | + } |
| 139 | + } |
| 140 | +] |
| 141 | +``` |
0 commit comments