Skip to content

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

Notifications You must be signed in to change notification settings

ericm/healscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
  • 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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages