FROM elasticsearch:6.4.3
# -1: PID大于1的所有进程均接收信号。
HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
CMD curl --silent --fail localhost:9200/_cluster/health || bash -c 'kill -s 15 -1 && (sleep 10; kill -s 9 -1)'
docker build -t es_health .
docker run --restart=always -d es_health