Keepalived Docker image for amd64
, i386
, arm64
, armv6
, armv7
.
docker run \
--name keepalived \
--cap-add=NET_ADMIN \
--net=host \
--detach \
ghcr.io/rmartin16/keepalived:v2.2.7
The configuration can be set using environment variables:
docker run \
--env INTERFACE=eth1 \
--env STATE=BACKUP \
--name keepalived \
--cap-add=NET_ADMIN \
--net=host \
--detach \
ghcr.io/rmartin16/keepalived:v2.2.7
- INTERFACE: Defaults to
eth0
- STATE: Default state. Defaults to
BACKUP
- ROUTER_ID: Virtual router ID. Defaults to
41
- PRIORITY: Node priority. Defaults to
100
- UNICAST_PEERS: Unicast peers, space-separated. Defaults to
192.168.2.101 192.168.2.102 192.168.2.103
- VIRTUAL_IPS: Defaults to
192.168.2.100/24
- PASSWORD: Defaults to
KeptAliv
- NOTIFY: Notify script. Defaults to
/notify.sh
Example:
docker run \
--name keepalived \
--cap-add=NET_ADMIN \
--net=host \
--volume $(pwd)/keepalived.conf:/etc/keepalived/keepalived.conf \
--detach \
ghcr.io/rmartin16/keepalived:v2.2.7
version: "3"
services:
keepalived:
container_name: keepalived
image: ghcr.io/rmartin16/keepalived:v2.2.7
network_mode: host
cap_add:
- NET_ADMIN
volumes:
- ./config/keepalived/keepalived.conf:/etc/keepalived/keepalived.conf
restart: unless-stopped
Oracle Linux Administrator's Guide
Direct parent: rvben/rpi-keepalived
Transitive parent: osixia/docker-keepalived