
peterweissdk/keepalived support.
Run the container:
bash# Pull the image docker pull peterweissdk/keepalived # Run with custom configuration docker run -d \ --name keepalived \ --restart=unless-stopped \ --cap-add=NET_ADMIN \ --cap-add=NET_BROADCAST \ --cap-add=NET_RAW \ --net=host \ --env-file .env \ keepalived:latest # Run the container using the provided Docker Compose and .env file docker compose up -d
| Variable | Description | Example |
|---|---|---|
TZ | Container timezone | Europe/Copenhagen |
VRRP_INSTANCE | VRRP instance name | VI_1 |
INTERFACE | Network interface | eth0 |
STATE | Node state (MASTER/BACKUP) | MASTER |
PRIORITY | Node priority (1-255) | 100 |
ROUTER_ID | Unique router ID | 52 |
VIRTUAL_IPS | Virtual IP address with subnet mask | 192.168.1.100/24 |
UNICAST_SRC_IP | Source IP for unicast communication | 192.168.1.101 |
UNICAST_PEERS | Peer IP addresses for unicast communication | 192.168.1.102 |
WEIGHT | Weight for tracked scripts | 50 |
FALL | Number of failures before transition | 2 |
RISE | Number of successes before transition | 2 |
Create a script to run at regular intervals to check the state of your service. Create a bind mount and copy the script into it
bash# Clone the repository git clone [***] cd keepalived # Build the image docker build -t keepalived:latest .
bashkeepalived/ ├── conf/ │ └── keepalived.conf_tpl ├── scripts/ │ └── check_and_run.sh ├── .github/ ├── .env ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── docker-compose.yml ├── LICENSE └── README.md
The container includes a comprehensive health check system that monitors:
Keepalived Process Status
Virtual IP environment variable
View health status:
bashdocker inspect --format='{{.State.Health.Status}}' keepalived
View detailed health check history:
bashdocker inspect --format='{{json .State.Health}}' keepalived | jq
Watch health status in real-time:
bashwatch -n 5 'docker inspect --format="{{.State.Health.Status}}" keepalived'
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or need support, please file an issue on the GitHub repository.
This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.0 - see the LICENSE file for details.


manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务