@@ -407,10 +407,8 @@ instead. The command must:
407
407
* Bind-mount the `config` directory. The command will create an
408
408
`elasticsearch.keystore` file in this directory. To avoid errors, do
409
409
not directly bind-mount the `elasticsearch.keystore` file.
410
- * Use the `elasticsearch-keystore` tool with the `create` option.
411
- * Provide a keystore password using the `KEYSTORE_PASSWORD` or
412
- `KEYSTORE_PASSWORD_FILE` environment variables. Alternatively, you can use
413
- `elasticsearch-keystore` tool's `-p` option to use a password prompt.
410
+ * Use the `elasticsearch-keystore` tool with the `create -p` option. You'll be
411
+ prompted to enter a password for the keystore.
414
412
415
413
ifeval::["{release-state}"!="unreleased"]
416
414
For example:
@@ -420,12 +418,12 @@ For example:
420
418
docker run -it --rm \
421
419
-v full_path_to/config:/usr/share/elasticsearch/config \
422
420
docker.elastic.co/elasticsearch/elasticsearch:{version} \
423
- bin/elasticsearch-keystore create \
424
- -E KEYSTORE_PASSWORD=mypassword
421
+ bin/elasticsearch-keystore create -p
425
422
----
426
423
427
424
You can also use a `docker run` command to add or update secure settings in the
428
- keystore. You'll receive a prompt to enter setting values.
425
+ keystore. You'll be prompted to enter the setting values. If the keystore is
426
+ encrypted, you'll also be prompted to enter the keystore password.
429
427
430
428
[source,sh,subs="attributes"]
431
429
----
@@ -434,10 +432,26 @@ docker run -it --rm \
434
432
docker.elastic.co/elasticsearch/elasticsearch:{version} \
435
433
bin/elasticsearch-keystore \
436
434
add my.secure.setting \
437
- my.other.secure.setting \
435
+ my.other.secure.setting
438
436
----
439
437
endif::[]
440
438
439
+ If you've already created the keystore and don't need to update it, you can
440
+ bind-mount the `elasticsearch.keystore` file directly. For example, you can
441
+ add the following to `docker-compose.yml`:
442
+
443
+ [source,yaml]
444
+ ----
445
+ elasticsearch:
446
+ ...
447
+ volumes:
448
+ ...
449
+ - type: bind
450
+ source: full_path_to/config/elasticsearch.keystore
451
+ target: /usr/share/elasticsearch/config/elasticsearch.keystore
452
+ ----
453
+
454
+
441
455
[[_c_customized_image]]
442
456
===== Using custom Docker images
443
457
In some environments, it might make more sense to prepare a custom image that contains
0 commit comments