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 '
2
2
3
3
services :
4
4
idrac1 :
@@ -21,11 +21,18 @@ services:
21
21
ports :
22
22
- 5801:5800
23
23
- 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
28
28
volumes :
29
29
- /path/to/app:/app
30
30
- /path/to/media:/vmedia
31
31
- /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'
6
6
7
7
echo " Starting"
8
8
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
+
9
29
if [ -z " ${IDRAC_HOST} " ]; then
10
30
echo " ${RED} Please set a proper idrac host with IDRAC_HOST${NC} "
11
31
sleep 2
You can’t perform that action at this time.
0 commit comments