osixia / docker-keepalived

Keepalived container image 🐳🌴
MIT License
402 stars 146 forks source link

How to use the '--config-id' command line option #37

Closed orenye closed 4 years ago

orenye commented 4 years ago

Hi,

I want to use keepalived's conditional configuration which requires the image to pass the '--config-id' command line option to keepalived. Apparently this is blocked as can be seen here:

$ docker run --rm --cap-add=NET_ADMIN --net=host --name kad -v /data/keepalived.conf:/container/service/keepalived/assets/keepalived.conf osixia/keepalived:2.0.19 --copy-service --config-id main
usage: run [-h] [-e] [-s] [-p] [-f] [-o {startup,process,finish}]
           [-c COMMAND [WHEN={startup,process,finish} ...]] [-k]
           [--wait-state FILENAME] [--wait-first-startup] [--keep-startup-env]
           [--copy-service] [--dont-touch-etc-hosts] [--keepalive]
           [--keepalive-force] [-l {none,error,warning,info,debug,trace}]
           [MAIN_COMMAND [MAIN_COMMAND ...]]
run: error: unrecognized arguments: --config-id

Is it supported somehow? Thanks

orenye commented 4 years ago

OK, found the way to set it: -e KEEPALIVED_COMMAND_LINE_ARGUMENTS="--config-id main"