Skip to content

New config isnt copied on container restart #49

@defcon84

Description

@defcon84

Everytime i update the linked keepalived config on the host, i need to stop and remove the container, then create it again.
A container restart, recreate or edit(re-deploy through Portainer) does not copy the changed config file to the local folder.

I now do this:

sudo docker container stop keepalived
sudo docker container rm keepalived
sudo docker-compose up -d

And to test if the new config is loaded
sudo docker exec keepalived cat /usr/local/etc/keepalived/keepalived.conf

It should copy and use the new config file on every (re)start.

I use the following docker-compose config:

  keepalived:
    container_name: keepalived
    image: osixia/keepalived:2.0.20
    network_mode: host
    pid: host
    volumes:
      - /srv/docker/keepalived/keepalived.conf:/container/service/keepalived/assets/keepalived.conf
    restart: always
    cap_add:
      - NET_ADMIN
      - NET_BROADCAST
      - NET_RAW
    command: [--copy-service, --loglevel, debug]
    environment:
      KEEPALIVED_COMMAND_LINE_ARGUMENTS: >-
        --log-detail
        --log-console

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions