Skip to content

Persist elasticsearch.keystore or add data before the first container starts? #579

@cebor

Description

@cebor

Hi, ist there anyway to persist the elasticsearch.keystore or add things to the keystore before the container starts elasticsearch?

My problem is, i need to add a client.secret before the container starts the first time and also want to persist this data after a docker-compose stop.

  1. I tried:
docker-compose run elasticsearch bin/elasticsearch-keystore add xpack.security.authc.realms.oidc.oidc1.rp.client_secret

But data is gone on the next startup.

  1. I tried to add the following to the docker-compose.yml
elasticsearch:
...
  volumes:
    ...
    - type: bind
      source: ./elasticsearch/config/elasticsearch.keystore
      target: /usr/share/elasticsearch/config/elasticsearch.keystore

Also does not work, because keystore must exist before the startup. Creating an empty file before does not help, because its the wrong format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    workaroundWorkaround to a problem that can't be immediately addressed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions