From b3a0be95908adfd8b9c798ea2d4c4f9cda76080f Mon Sep 17 00:00:00 2001 From: Vincent Sijben <36117924+vincentsijben@users.noreply.github.com> Date: Sat, 10 Aug 2019 22:18:34 +0200 Subject: [PATCH 1/3] update rexray example with secret - typo bride -> bridge - add secret, env and updated the command line --- stack-rexray.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/stack-rexray.yml b/stack-rexray.yml index e97eb85..5624560 100644 --- a/stack-rexray.yml +++ b/stack-rexray.yml @@ -1,6 +1,6 @@ version: "3.7" -# 1. WORKAROUND: would prefer this use null network driver, will use bride for now to avoid overlay +# 1. WORKAROUND: would prefer this use null network driver, will use bridge for now to avoid overlay # 2. TODO: would prefer on-failure restart_policy, but need to run this in script to look # for if plugin exists first before reinstalling # 3. TODO: would prefer this picks a driver version, and support driver updates @@ -22,13 +22,21 @@ services: - bridge volumes: - /var/run/docker.sock:/var/run/docker.sock - command: docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN="${REXRAY_DO_TOKEN}" DOBS_CONVERTUNDERSCORES=true - # TODO: make token a secret + secrets: + - rexray_do_token + environment: + - REXRAY_DO_TOKEN_FILE=/run/secrets/rexray_do_token + command: sh -c "docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN=`cat $REXRAY_DO_TOKEN_FILE` DOBS_CONVERTUNDERSCORES=true" deploy: mode: global restart_policy: condition: none +secrets: + rexray_do_token: + external: true + name: rexray_do_token + networks: bridge: external: true From 14b94014c664bb49ab8d513182a863b64e370ae5 Mon Sep 17 00:00:00 2001 From: Vincent Sijben <36117924+vincentsijben@users.noreply.github.com> Date: Sun, 11 Aug 2019 20:36:27 +0200 Subject: [PATCH 2/3] Update stack-rexray.yml --- stack-rexray.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack-rexray.yml b/stack-rexray.yml index 5624560..ce128d6 100644 --- a/stack-rexray.yml +++ b/stack-rexray.yml @@ -26,7 +26,7 @@ services: - rexray_do_token environment: - REXRAY_DO_TOKEN_FILE=/run/secrets/rexray_do_token - command: sh -c "docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN=`cat $REXRAY_DO_TOKEN_FILE` DOBS_CONVERTUNDERSCORES=true" + command: sh -c "docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN=`cat $${REXRAY_DO_TOKEN_FILE}` DOBS_CONVERTUNDERSCORES=true" deploy: mode: global restart_policy: From ad92ee2616cf72ab640306c3d3621984d746d60b Mon Sep 17 00:00:00 2001 From: Vincent Sijben <36117924+vincentsijben@users.noreply.github.com> Date: Sun, 11 Aug 2019 21:53:31 +0200 Subject: [PATCH 3/3] Update stack-rexray.yml --- stack-rexray.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack-rexray.yml b/stack-rexray.yml index ce128d6..9d3a531 100644 --- a/stack-rexray.yml +++ b/stack-rexray.yml @@ -26,7 +26,7 @@ services: - rexray_do_token environment: - REXRAY_DO_TOKEN_FILE=/run/secrets/rexray_do_token - command: sh -c "docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN=`cat $${REXRAY_DO_TOKEN_FILE}` DOBS_CONVERTUNDERSCORES=true" + command: sh -c "docker plugin install --grant-all-permissions rexray/dobs DOBS_REGION=nyc3 DOBS_TOKEN=$$(cat $$REXRAY_DO_TOKEN_FILE) DOBS_CONVERTUNDERSCORES=true" deploy: mode: global restart_policy: