Self-operating Debian Jessie image
1.4K
Rebuild FROM {{ this.image }} with your own containerpilot.json, zabbix_agentd.conf (or other event management process) by placing them in /etc from your build directory so ONBUILD hook will pick them up (ONBUILD COPY etc /etc). Then COPY application binary (ONBUILD COPY bin /bin) and pass start script or binary path using CMD
FROM mesoform/concierge-debian-base-image
CMD ["/usr/local/bin/my_app_binary", "-a", "parameter"]
Should look as follows:
├── Dockerfile
├── bin/
| └── my_app_binary
└── etc/
├── app/
| └── my_app.conf
├── containerpilot.json
└── coprocesses/
└── zabbix/
└── zabbix_agentd.conf
{
"consul": "{{ if .CONSUL_AGENT }}localhost{{ else }}{{ if .CONSUL }}{{ .CONSUL }}{{ else }}consul{{ end }}{{ end }}:8500",
"preStart": ["/usr/local/bin/setdomain.sh"],
"preStop": ["zabbix_sender",
"-c", "/etc/coprocesses/zabbix/zabbix_agentd.conf",
"--key", "container.state",
"--value", "removing"],
"postStop": ["zabbix_sender",
"-c", "/etc/coprocesses/zabbix/zabbix_agentd.conf",
"--key", "container.state",
"--value", "exited"],
"logging": {
"level": "{{ .LOG_LEVEL }}",
"format": "{{ .LOG_FORMAT }}"
},
"services": [
{
"name": "hello-world",
"port": 80,
"health": "ping -c 1 -q www.bbc.co.uk",
"poll": 10,
"ttl": 30,
"tags": ["hello", "world"],
"consul": {
"enableTagOverride": true,
"deregisterCriticalServiceAfter": "90m"
}
}
],
"tasks": [
{
"name": "scheduling_status",
"command": ["zabbix_sender",
"-c", "/etc/coprocesses/zabbix/zabbix_agentd.conf",
"--key", "container.state",
"--value", "running"],
"frequency": "10000ms",
"timeout": "3000ms"
}
],
"coprocesses": [
{
"name": "zabbix_agent",
"command": ["/usr/sbin/zabbix_agentd", "-fc", "/etc/coprocesses/zabbix/zabbix_agentd.conf"],
"restarts": 3
},
{{ if .CONSUL_AGENT }}
{
"command": ["/usr/local/bin/consul-agent.sh"],
"restarts": "unlimited"
}{{ end }}
]
}
Alternatively you can look at using the concierge-app-playbook where the configuration code is already written and helps you get setup in a declarative manner.
Example repository will follow and more details can be found on our Concierge Paradigm blog
Content type
Image
Digest
Size
254.4 MB
Last updated
about 7 years ago
docker pull mesoform/concierge-debian-base-image