From cfac223cffbe6368836f2505ef1decdd71a623c4 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Thu, 4 Mar 2021 13:02:28 -0800 Subject: [PATCH] Document configtree support for Docker secrets Closes gh-25095 --- .../src/docs/asciidoc/spring-boot-features.adoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index cdd6728b34a..8da640a7ddc 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -875,6 +875,18 @@ NOTE: Directories loaded using a wildcard are sorted alphabetically. If you need a different order, then you should list each location as a separate import +Configuration trees can also be used for Docker secrets. +When a Docker swarm service is granted access to a secret, the secret gets mounted into the container. +For example, if a secret named `db.password` is mounted at location `/run/secrets/`, you can make `db.password` available to the Spring environment using the following: + +[source,yaml,indent=0,configprops,configblocks] +---- + spring: + config: + import: "optional:configtree:/run/secrets/" +---- + + [[boot-features-external-config-placeholders-in-properties]] ==== Property Placeholders