Builds a alpine-monit base image with monit compiled and installed in /opt/monit.
4.2K
A base image to run anything. It's based in alpine-base, adding monit as process management
docker build -t rawmind/alpine-monit:<version> .
This image compiles and intall monit under /opt/monit, to make it super simple to start multiple process and manage them correctly.
Starts automatically all services conf files that would be copied in /opt/monit/etc/conf.d or /opt/tools/monit/conf.d (*)
5.25-3 (Dockerfile) Monit version 5.25.25.24-0 (Dockerfile) Monit version 5.245.23 (Dockerfile) Monit version 5.230.5.20-4 (Dockerfile) Monit version 5.200.5.19-2 (Dockerfile) Monit version 5.190.5.18-6 (Dockerfile) Monit version 5.180.3.3-2 (Dockerfile) Monit version 5.16This image runs monit in foreground.
Besides, you can customize the configuration in several ways:
Monit is installed with the default configuration and some parameters can be overrided with env variables:
To use this image include FROM rawmind/alpine-monit at the top of your Dockerfile. Starting from rawmind/alpine-monit provides you with the ability to easily start any service using monit. monit will also keep it running for you, restarting it when it crashes.
To start your service using monit:
/opt/monit/etc/conf.dmonit conf
check process <service> with pidfile <service-pid-file>
start program = "<path>/service.sh start"
stop program = "<path>/service.sh stop"
if failed port <port> type tcp then restart
service script
#!/usr/bin/env bash
SERVICE_NAME=zk
SERVICE_HOME=${SERVICE_HOME:-"<service-home>"}
SERVICE_CONF=${SERVICE_CONF:-"0"}
function log {
echo `date` $ME - $@
}
function serviceLog {
log "[ Redirecting ${SERVICE_NAME} log... ]"
ln -sf /proc/1/fd/1 <service log file>
}
function serviceStart {
log "[ Starting ${SERVICE_NAME}... ]"
<commands to start service>
}
function serviceStop {
log "[ Stoping ${SERVICE_NAME}... ]"
<commands to stop service>
}
function serviceRestart {
log "[ Restarting ${SERVICE_NAME}... ]"
serviceStop
serviceStart
}
case "$1" in
"start")
serviceLog
serviceStart
;;
"stop")
serviceStop
;;
"restart")
serviceRestart
;;
*) echo "Usage: $0 restart|start|stop"
;;
esac
Examples of using this image can be found at alpine-zk or at alpine-kafka.
Content type
Image
Digest
Size
9.5 MB
Last updated
about 4 years ago
docker pull rawmind/alpine-monit:5.32-0