forked from jas88/smideploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerbits.sh
executable file
·201 lines (187 loc) · 9.4 KB
/
dockerbits.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
set -e
apt-get update
apt-get install -y --no-install-recommends wget software-properties-common gnupg2
## Team RabbitMQ's main signing key
apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
## Cloudsmith: modern Erlang repository
wget -qO- https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | apt-key add -
## Cloudsmith: RabbitMQ repository
wget -qO- https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | apt-key add -
apt-key add <<EOK
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)
mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT
LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV
7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag
OeizPX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sQxKavpIGzaDhWyrVAig3XXF//zxowYVwuOikr5czgqizu87cqjpyn
S0vVG4Q3+LswH4xVTn3UWadY/9FkM167ecouu4g3op29VDi7hCKsMeFvFP6OOIls
G4vQ/QbzucK77Q==
=eD3N
-----END PGP PUBLIC KEY BLOCK-----
EOK
add-apt-repository -u "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main"
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" > /etc/apt/sources.list.d/mongodb-org-4.4.list
## Add apt repositories maintained by Team RabbitMQ
tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main
deb-src https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main
## Provides RabbitMQ
##
deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
deb-src https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
EOF
add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main"
add-apt-repository -u "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/mssql-server-2019 bionic main"
apt-get update
ACCEPT_EULA=Y apt-get install -y --no-install-recommends libtinfo5 rabbitmq-server mssql-tools mariadb-server default-jre-headless mongodb-org redis-server
apt-get install -y --no-install-recommends mssql-server
MSSQL_SA_PASSWORD="YourStrong\!Passw0rd" /opt/mssql/bin/sqlservr --pid 3 --setup --reset-sa-password --accept-eula
/opt/mssql/bin/sqlservr &
sleep 10
# Disable irrelenvant .Net L16n to avoid extra dependencies or a coredump from RDMP
cat > /rdmp-cli/rdmp.runtimeconfig.json <<EOJ
{
"runtimeOptions": {
"configProperties": {
"System.Globalization.Invariant": true
},
"tfm": "net5.0",
"includedFrameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "5.0.3"
}
]
}
}
EOJ
ln -f /rdmp-cli/rdmp.runtimeconfig.json /smi/smi.runtimeconfig.json
./rdmp-cli/rdmp install localhost TEST_ -u sa -p "YourStrong\!Passw0rd"
kill -TERM `jobs -p`
mkdir -p /data/db
echo -e '\nreplication:\n replSetName: rs0' >> /etc/mongodb.conf
mongod -f /etc/mongodb.conf &
sleep 10
mongo --eval 'rs.initiate()'
kill -TERM `jobs -p`
echo "NODENAME=rabbit@localhost" > /etc/rabbitmq/rabbitmq-env.conf
mkdir -p /var/lib/rabbitmq
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq
rabbitmq-server &
sleep 15
rabbitmq-plugins enable rabbitmq_management < /dev/null
wget -O/bin/rabbitmqadmin http://127.0.0.1:15672/cli/rabbitmqadmin
chmod +x /bin/rabbitmqadmin
# RABBITGOESHERE
kill -TERM `jobs -p`
cat > /smi.yaml <<EOY
jobs:
- "/opt/mssql/bin/sqlservr"
- "/usr/bin/mongod"
- "/usr/bin/redis-server"
- "/usr/sbin/mysqld"
- "/usr/sbin/rabbitmq-server"
- "wait"
- "/usr/bin/java -jar /smi/smi-nerd-v3.0.2.jar"
- "/usr/bin/java -jar /smi/CTPAnonymiser-portable-1.0.0.jar -a /smi/ctp-whitelist.script -y /smi.yaml"
- "/smi/smi dicom-relational-mapper -y /smi.yaml"
- "/smi/smi is-identifiable service -y /smi.yaml"
- "/smi/smi cohort-extractor -y /smi.yaml"
- "/smi/smi dicom-tag-reader -y /smi.yaml"
- "/smi/smi mongodb-populator -y /smi.yaml"
- "/smi/smi cohort-packager -y /smi.yaml"
- "/smi/smi file-copier -y /smi.yaml"
- "/smi/smi identifier-mapper -y /smi.yaml"
- "/smi/smi update-values -y /smi.yaml"
EOY
sed -e 's/c:\\temp/\/tmp/gi' /smi/default.yaml | tail -n +2 >> /smi.yaml