File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 1+ idrac_host.txt
2+ idrac_password.txt
3+ idrac_user.txt
4+ idrac_port.txt
Original file line number Diff line number Diff line change 1- version : ' 2 '
1+ version : ' 3.1 '
22
33services :
44 idrac1 :
@@ -21,11 +21,18 @@ services:
2121 ports :
2222 - 5801:5800
2323 - 5901:5900
24- environment :
25- - IDRAC_HOST=idrac2.example.org
26- - IDRAC_USER=root
27- - IDRAC_PASSWORD=1234
24+ secrets :
25+ - idrac_host
26+ - idrac_user
27+ - idrac_password
2828 volumes :
2929 - /path/to/app:/app
3030 - /path/to/media:/vmedia
3131 - /path/to/screenshots:/screenshots
32+ secrets :
33+ idrac_host :
34+ file : ./idrac_host.txt
35+ idrac_user :
36+ file : ./idrac_user.txt
37+ idrac_password :
38+ file : ./idrac_password.txt
Original file line number Diff line number Diff line change @@ -6,6 +6,26 @@ NC='\033[0m'
66
77echo " Starting"
88
9+ if [ -f " /run/secrets/idrac_host" ]; then
10+ echo " Using Docker secret for IDRAC_HOST"
11+ IDRAC_HOST=" $( cat /run/secrets/idrac_host) "
12+ fi
13+
14+ if [ -f " /run/secrets/idrac_port" ]; then
15+ echo " Using Docker secret for IDRAC_PORT"
16+ IDRAC_PORT=" $( cat /run/secrets/idrac_port) "
17+ fi
18+
19+ if [ -f " /run/secrets/idrac_user" ]; then
20+ echo " Using Docker secret for IDRAC_USER"
21+ IDRAC_USER=" $( cat /run/secrets/idrac_user) "
22+ fi
23+
24+ if [ -f " /run/secrets/idrac_password" ]; then
25+ echo " Using Docker secret for IDRAC_PASSWORD"
26+ IDRAC_PASSWORD=" $( cat /run/secrets/idrac_password) "
27+ fi
28+
929if [ -z " ${IDRAC_HOST} " ]; then
1030 echo " ${RED} Please set a proper idrac host with IDRAC_HOST${NC} "
1131 sleep 2
You can’t perform that action at this time.
0 commit comments