Docker Autoheal监控并重启不健康的docker容器

autoheal的docker镜像「autoheal.tar」下载链接:https://pan.quark.cn/s/47684b60bb8f

一、导入镜像

docker  load  -i  autoheal.tar

Docker Autoheal监控并重启不健康的docker容器_第1张图片

二、查看镜像

docker  images

在这里插入图片描述

三、运行容器
方式1、直接运行

docker run -d --name autoheal --restart=always -e AUTOHEAL_CONTAINER_LABEL=all -v /var/run/docker.sock:/var/run/docker.sock willfarrell/autoheal

方式2、docker-compose运行

services:
  autoheal:
    image: willfarrell/autoheal:latest
    container_name: autoheal
    restart: always
    network_mode: none
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "5"
    environment:
      AUTOHEAL_CONTAINER_LABEL: autoheal-app
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock

你可能感兴趣的:(docker,java,容器)