ericm / healscript

Docker image that runs a user-defined script whenever a specific container becomes unhealthy

Home Page:https://hub.docker.com/r/moynihan/healscript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker HealScript

This is a Docker image that runs a user-defined script whenever a specific container becomes unhealthy. It maps to scripts in the /scripts directory and if an image X is found to be unhealthy, it will run /scripts/X.sh

Usage

docker

docker run -it \
-v /path/to/scripts:/scripts \
-v /var/run/docker.sock:/var/run/docker.sock \
moynihan/healscript:latest

docker-compose

version: "3"
services:
  healscript:
    image: moynihan/healscript:latest
    volumes:
      - /path/to/scripts:/scripts
      - /var/run/docker.sock:/var/run/docker.sock

Example script

# /script/X.sh
docker logs Y
docker restart X Y Z

Images

  • moynihan/healscript:{latest|x86_64}

  • moynihan/healscript:armhf

Based off of https://github.com/willfarrell/docker-autoheal

About

Docker image that runs a user-defined script whenever a specific container becomes unhealthy

https://hub.docker.com/r/moynihan/healscript


Languages

Language:Shell 87.1%Language:Dockerfile 12.9%