From 853dd000d50847e77867a1bb0ebd40ac8966d2b1 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Wed, 21 Oct 2020 11:56:45 +0200 Subject: [PATCH] Add absolute path docs Signed-off-by: Ulysses Souza --- docs/aci-compose-features.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/aci-compose-features.md b/docs/aci-compose-features.md index 6879ab540..92d077e00 100644 --- a/docs/aci-compose-features.md +++ b/docs/aci-compose-features.md @@ -149,7 +149,37 @@ secrets: The nginx container will have secret1 mounted as `/run/secrets/mysecret1`, the db container will have secret2 mounted as `/run/secrets/mysecret2` -**Note that file paths are not allowed in the target** +A target can also be specified to set the name of the mounted file or by specifying an absolute path where to mount the secret file + +```yaml +services: + nginx: + image: nginx + secrets: + - source: mysecret1 + target: renamedsecret1.txt + db: + image: mysql + secrets: + - source: mysecret1 + target: /mnt/dbmount/mysecretonmount1.txt + - source: mysecret2 + target: /mnt/dbmount/mysecretonmount2.txt + +secrets: + mysecret1: + file: ./my_secret1.txt + mysecret2: + file: ./my_secret2.txt +``` + +In this example the `nginx` service will have its secret mounted in `/run/secrets/renamedsecret1.txt` and `db` will have 2 files (`mysecretonmount1.txt` and `mysecretonmount2.txt`). +Both of them with be mounted in the same folder (`/mnt/dbmount/`). + + +**Note that absolute file paths are not allowed in the target** + +**The target folder will be empty when mounting inside** ## Container Resources