Update Apps
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
# Docker Autoheal
|
||||
|
||||
Monitor and restart unhealthy docker containers.
|
||||
This functionality was proposed to be included with the addition of `HEALTHCHECK`, however didn't make the cut.
|
||||
This container is a stand-in till there is native support for `--exit-on-unhealthy` https://github.com/docker/docker/pull/22719.
|
||||
监控并重启不健康的 Docker 容器。此功能曾提议在增加 \``HEALTHCHECK`\` 后包含进来,但最终未能实现。此容器是一个临时替代品,直到有原生支持 \``--exit-on-unhealthy`\`[https://github.com/docker/docker/pull/22719](https://github.com/docker/docker/pull/22719)。
|
||||
|
||||
## Supported tags and Dockerfile links
|
||||
- [`latest` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/main/Dockerfile) - Built daily
|
||||
- [`1.1.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/1.1.0/Dockerfile)
|
||||
- [`v0.7.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/v0.7.0/Dockerfile)
|
||||
## 支持的标签和 Dockerfile 链接
|
||||
|
||||
* [`latest` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/main/Dockerfile) - 每日构建
|
||||
* [`1.1.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/1.1.0/Dockerfile)
|
||||
* [`v0.7.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/v0.7.0/Dockerfile)
|
||||
|
||||
 [](http://microbadger.com/images/willfarrell/autoheal "Docker layer breakdown")
|
||||
|
||||
## How to use
|
||||
### UNIX socket passthrough
|
||||
## 如何使用
|
||||
|
||||
### UNIX 套接字透传
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name autoheal \
|
||||
@@ -21,7 +22,9 @@ docker run -d \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
willfarrell/autoheal
|
||||
```
|
||||
|
||||
### TCP socket
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name autoheal \
|
||||
@@ -31,28 +34,31 @@ docker run -d \
|
||||
-v /path/to/certs/:/certs/:ro \
|
||||
willfarrell/autoheal
|
||||
```
|
||||
a) Apply the label `autoheal=true` to your container to have it watched.
|
||||
|
||||
b) Set ENV `AUTOHEAL_CONTAINER_LABEL=all` to watch all running containers.
|
||||
a) 在你的容器上应用标签 \``autoheal=true`\` 以使其被监控。
|
||||
|
||||
c) Set ENV `AUTOHEAL_CONTAINER_LABEL` to existing label name that has the value `true`.
|
||||
b) 设置环境变量 \``AUTOHEAL_CONTAINER_LABEL=all`\` 以监控所有运行中的容器。
|
||||
|
||||
Note: You must apply `HEALTHCHECK` to your docker images first. See https://docs.docker.com/engine/reference/builder/#healthcheck for details.
|
||||
See https://docs.docker.com/engine/security/https/ for how to configure TCP with mTLS
|
||||
c) 设置环境变量 \``AUTOHEAL_CONTAINER_LABEL`\` 为具有值 \``true`\` 的现有标签名称。
|
||||
|
||||
The certificates, and keys need these names:
|
||||
* ca.pem
|
||||
* client-cert.pem
|
||||
* client-key.pem
|
||||
注意:您必须首先将 `HEALTHCHECK` 应用于您的 Docker 镜像。详情请参阅 [https://docs.docker.com/engine/reference/builder/#healthcheck](https://docs.docker.com/engine/reference/builder/#healthcheck)。有关如何使用 mTLS 配置 TCP,请参阅 [https://docs.docker.com/engine/security/https/](https://docs.docker.com/engine/security/https/)。
|
||||
|
||||
证书和密钥需要以下名称:
|
||||
|
||||
* ca.pem
|
||||
* client-cert.pem
|
||||
* client-key.pem
|
||||
|
||||
### 更改时区
|
||||
|
||||
如果需要时区与本地机器一致,可以将 `/etc/localtime` 映射到容器中。
|
||||
|
||||
### Change Timezone
|
||||
If you need the timezone to match the local machine, you can map the `/etc/localtime` into the container.
|
||||
```
|
||||
docker run ... -v /etc/localtime:/etc/localtime:ro
|
||||
```
|
||||
|
||||
## ENV 默认设置
|
||||
|
||||
## ENV Defaults
|
||||
```
|
||||
AUTOHEAL_CONTAINER_LABEL=autoheal
|
||||
AUTOHEAL_INTERVAL=5 # check every 5 seconds
|
||||
@@ -63,12 +69,14 @@ CURL_TIMEOUT=30 # --max-time seconds for curl requests to Docker API
|
||||
WEBHOOK_URL="" # post message to the webhook if a container was restarted (or restart failed)
|
||||
```
|
||||
|
||||
### Optional Container Labels
|
||||
### 可选容器标签
|
||||
|
||||
```
|
||||
autoheal.stop.timeout=20 # Per containers override for stop timeout seconds during restart
|
||||
```
|
||||
|
||||
## Testing
|
||||
## 测试
|
||||
|
||||
```bash
|
||||
docker build -t autoheal .
|
||||
|
||||
|
||||
79
apps/autoheal/README_en.md
Normal file
79
apps/autoheal/README_en.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Docker Autoheal
|
||||
|
||||
Monitor and restart unhealthy docker containers.
|
||||
This functionality was proposed to be included with the addition of `HEALTHCHECK`, however didn't make the cut.
|
||||
This container is a stand-in till there is native support for `--exit-on-unhealthy` https://github.com/docker/docker/pull/22719.
|
||||
|
||||
## Supported tags and Dockerfile links
|
||||
- [`latest` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/main/Dockerfile) - Built daily
|
||||
- [`1.1.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/1.1.0/Dockerfile)
|
||||
- [`v0.7.0` (*Dockerfile*)](https://github.com/willfarrell/docker-autoheal/blob/v0.7.0/Dockerfile)
|
||||
|
||||
 [](http://microbadger.com/images/willfarrell/autoheal "Docker layer breakdown")
|
||||
|
||||
## How to use
|
||||
### UNIX socket passthrough
|
||||
```bash
|
||||
docker run -d \
|
||||
--name autoheal \
|
||||
--restart=always \
|
||||
-e AUTOHEAL_CONTAINER_LABEL=all \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
willfarrell/autoheal
|
||||
```
|
||||
### TCP socket
|
||||
```bash
|
||||
docker run -d \
|
||||
--name autoheal \
|
||||
--restart=always \
|
||||
-e AUTOHEAL_CONTAINER_LABEL=all \
|
||||
-e DOCKER_SOCK=tcp://HOST:PORT \
|
||||
-v /path/to/certs/:/certs/:ro \
|
||||
willfarrell/autoheal
|
||||
```
|
||||
a) Apply the label `autoheal=true` to your container to have it watched.
|
||||
|
||||
b) Set ENV `AUTOHEAL_CONTAINER_LABEL=all` to watch all running containers.
|
||||
|
||||
c) Set ENV `AUTOHEAL_CONTAINER_LABEL` to existing label name that has the value `true`.
|
||||
|
||||
Note: You must apply `HEALTHCHECK` to your docker images first. See https://docs.docker.com/engine/reference/builder/#healthcheck for details.
|
||||
See https://docs.docker.com/engine/security/https/ for how to configure TCP with mTLS
|
||||
|
||||
The certificates, and keys need these names:
|
||||
* ca.pem
|
||||
* client-cert.pem
|
||||
* client-key.pem
|
||||
|
||||
### Change Timezone
|
||||
If you need the timezone to match the local machine, you can map the `/etc/localtime` into the container.
|
||||
```
|
||||
docker run ... -v /etc/localtime:/etc/localtime:ro
|
||||
```
|
||||
|
||||
|
||||
## ENV Defaults
|
||||
```
|
||||
AUTOHEAL_CONTAINER_LABEL=autoheal
|
||||
AUTOHEAL_INTERVAL=5 # check every 5 seconds
|
||||
AUTOHEAL_START_PERIOD=0 # wait 0 seconds before first health check
|
||||
AUTOHEAL_DEFAULT_STOP_TIMEOUT=10 # Docker waits max 10 seconds (the Docker default) for a container to stop before killing during restarts (container overridable via label, see below)
|
||||
DOCKER_SOCK=/var/run/docker.sock # Unix socket for curl requests to Docker API
|
||||
CURL_TIMEOUT=30 # --max-time seconds for curl requests to Docker API
|
||||
WEBHOOK_URL="" # post message to the webhook if a container was restarted (or restart failed)
|
||||
```
|
||||
|
||||
### Optional Container Labels
|
||||
```
|
||||
autoheal.stop.timeout=20 # Per containers override for stop timeout seconds during restart
|
||||
```
|
||||
|
||||
## Testing
|
||||
```bash
|
||||
docker build -t autoheal .
|
||||
|
||||
docker run -d \
|
||||
-e AUTOHEAL_CONTAINER_LABEL=all \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
autoheal
|
||||
```
|
||||
Reference in New Issue
Block a user