-
Notifications
You must be signed in to change notification settings - Fork 8
/
generate.sh
executable file
·311 lines (259 loc) · 14.5 KB
/
generate.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#!/bin/bash
# This script uses lastversion
# To install lastversion:
# apt install python3-pip
# pip -q install --upgrade lastversion
set -x
export UBUNTU_ROLLING="jammy"
####
## SCRIPTS DEBIAN/UBUNTU BASE IMAGES
####
cp base/Dockerfile-template base/Dockerfile-devel
cp base/Dockerfile-template base/Dockerfile-rolling
cp base/Dockerfile-template base/Dockerfile-noble
cp base/Dockerfile-template base/Dockerfile-jammy
cp base/Dockerfile-template base/Dockerfile-focal
cp base/Dockerfile-template base/Dockerfile-bionic
cp base/Dockerfile-template base/Dockerfile-xenial
cp base/Dockerfile-template base/Dockerfile-trusty
cp base/Dockerfile-template base/Dockerfile-trixie
cp base/Dockerfile-template base/Dockerfile-bookworm
cp base/Dockerfile-template base/Dockerfile-bullseye
cp base/Dockerfile-template base/Dockerfile-buster
cp base/Dockerfile-template base/Dockerfile-stretch
cp base/Dockerfile-template base/Dockerfile-jessie
sed -i s/#TEMPLATE1#/ubuntu:devel/ base/Dockerfile-devel
sed -i s/"#TEMPLATE1#"/"ubuntu:${UBUNTU_ROLLING}"/ base/Dockerfile-rolling
sed -i s/#TEMPLATE1#/ubuntu:noble/ base/Dockerfile-noble
sed -i s/#TEMPLATE1#/ubuntu:jammy/ base/Dockerfile-jammy
sed -i s/#TEMPLATE1#/ubuntu:focal/ base/Dockerfile-focal
sed -i s/#TEMPLATE1#/ubuntu:bionic/ base/Dockerfile-bionic
sed -i s/#TEMPLATE1#/ubuntu:xenial/ base/Dockerfile-xenial
sed -i s/#TEMPLATE1#/ubuntu:trusty/ base/Dockerfile-trusty
sed -i s/#TEMPLATE1#/debian:trixie-slim/ base/Dockerfile-trixie
sed -i s/#TEMPLATE1#/debian:bookworm-slim/ base/Dockerfile-bookworm
sed -i s/#TEMPLATE1#/debian:buster-slim/ base/Dockerfile-buster
sed -i s/#TEMPLATE1#/debian:bullseye-slim/ base/Dockerfile-bullseye
sed -i s/#TEMPLATE1#/debian:stretch-slim/ base/Dockerfile-stretch
sed -i s/#TEMPLATE1#/debian:jessie-slim/ base/Dockerfile-jessie
sed -i s/#TEMPLATE2#/"${UBUNTU_ROLLING}"/ base/Dockerfile-rolling
sed -i s/#TEMPLATE2#/trixie/ base/Dockerfile-trixie
sed -i s/#TEMPLATE2#/noble/ base/Dockerfile-noble
sed -i s/#TEMPLATE2#/jammy/ base/Dockerfile-jammy
sed -i s/#TEMPLATE2#/focal/ base/Dockerfile-focal
sed -i s/#TEMPLATE2#/bionic/ base/Dockerfile-bionic
sed -i s/#TEMPLATE2#/xenial/ base/Dockerfile-xenial
sed -i s/#TEMPLATE2#/trusty/ base/Dockerfile-trusty
sed -i s/#TEMPLATE2#/bookworm/ base/Dockerfile-bookworm
sed -i s/#TEMPLATE2#/buster/ base/Dockerfile-buster
sed -i s/#TEMPLATE2#/bullseye/ base/Dockerfile-bullseye
sed -i s/#TEMPLATE2#/stretch/ base/Dockerfile-stretch
sed -i s/#TEMPLATE2#/jessie/ base/Dockerfile-jessie
git add base/Dockerfile*
git commit -m "autogenerated"
####
## SCRIPTS PHP-FPM
####
wget https://getcomposer.org/installer -O php-fpm/composer-setup.php
git add php-fpm/composer-setup.php
git commit -m "Changes from upstream"
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php56
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php72
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php74
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php80
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php81
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php82
cp php-fpm/Dockerfile-template.php php-fpm/Dockerfile-template.generated.php83
sed -i 's/#PHPVERSION#/5.6/' php-fpm/Dockerfile-template.generated.php56
sed -i 's/#PHPVERSION#/7.2/' php-fpm/Dockerfile-template.generated.php72
sed -i 's/#PHPVERSION#/7.4/' php-fpm/Dockerfile-template.generated.php74
sed -i 's/#PHPVERSION#/8.0/' php-fpm/Dockerfile-template.generated.php80
sed -i 's/#PHPVERSION#/8.1/' php-fpm/Dockerfile-template.generated.php81
sed -i 's/#PHPVERSION#/8.2/' php-fpm/Dockerfile-template.generated.php82
sed -i 's/#PHPVERSION#/8.3/' php-fpm/Dockerfile-template.generated.php83
sed -i 's/#removedinphp72#//' php-fpm/Dockerfile-template.generated.php56 #mcrypt
sed -i 's/#removedinphp74#//' php-fpm/Dockerfile-template.generated.php56 #recode
sed -i 's/#removedinphp80#//' php-fpm/Dockerfile-template.generated.php56 #json
sed -i 's/#removedinphp74#//' php-fpm/Dockerfile-template.generated.php72 #recode
sed -i 's/#removedinphp80#//' php-fpm/Dockerfile-template.generated.php72 #json
sed -i 's/#removedinphp80#//' php-fpm/Dockerfile-template.generated.php74 #json
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php56
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php72
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php74
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php80
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php81
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php82
sed -i '/#removedinphp/d' php-fpm/Dockerfile-template.generated.php83
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php56 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-5.6
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php72 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-7.2
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php74 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-7.4
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php80 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-8.0
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php81 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-8.1
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php82 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-8.2
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php83 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-8.3
cat php-fpm/Dockerfile-template.header \
php-fpm/Dockerfile-template.generated.php56 \
php-fpm/Dockerfile-template.generated.php72 \
php-fpm/Dockerfile-template.generated.php74 \
php-fpm/Dockerfile-template.generated.php80 \
php-fpm/Dockerfile-template.generated.php81 \
php-fpm/Dockerfile-template.generated.php82 \
php-fpm/Dockerfile-template.generated.php83 \
php-fpm/Dockerfile-template.footer > php-fpm/Dockerfile-multi
rm -f php-fpm/Dockerfile-template.generated.*
sed -i 's/#PHPVERSION#/5.6/' php-fpm/Dockerfile-5.6
sed -i 's/#PHPVERSION#/7.2/' php-fpm/Dockerfile-7.2
sed -i 's/#PHPVERSION#/7.4/' php-fpm/Dockerfile-7.4
sed -i 's/#PHPVERSION#/8.0/' php-fpm/Dockerfile-8.0
sed -i 's/#PHPVERSION#/8.1/' php-fpm/Dockerfile-8.1
sed -i 's/#PHPVERSION#/8.2/' php-fpm/Dockerfile-8.2
sed -i 's/#PHPVERSION#/8.3/' php-fpm/Dockerfile-8.3
sed -i 's/#PHPVERSION#/MULTI/' php-fpm/Dockerfile-multi
sed -i 's/MODE=FPM/MODE=MULTI/' php-fpm/Dockerfile-multi
sed -i 's/rm -rf \/etc\/php\/5.6/#rm -rf \/etc\/php\/5.6/' php-fpm/Dockerfile-5.6
sed -i 's/rm -rf \/etc\/php\/7.2/#rm -rf \/etc\/php\/7.2/' php-fpm/Dockerfile-7.2
sed -i 's/rm -rf \/etc\/php\/7.4/#rm -rf \/etc\/php\/7.4/' php-fpm/Dockerfile-7.4
sed -i 's/rm -rf \/etc\/php\/8.0/#rm -rf \/etc\/php\/8.0/' php-fpm/Dockerfile-8.0
sed -i 's/rm -rf \/etc\/php\/8.1/#rm -rf \/etc\/php\/8.1/' php-fpm/Dockerfile-8.1
sed -i 's/rm -rf \/etc\/php\/8.2/#rm -rf \/etc\/php\/8.2/' php-fpm/Dockerfile-8.2
sed -i 's/rm -rf \/etc\/php\/8.3/#rm -rf \/etc\/php\/8.3/' php-fpm/Dockerfile-8.3
sed -i 's/rm -rf \/etc\/php/#rm -rf \/etc\/php/' php-fpm/Dockerfile-multi
sed -i /zstd/d php-fpm/Dockerfile-5.6
sed -i /snuffleupagus/d php-fpm/Dockerfile-5.6
cp php-fpm/Dockerfile-5.6 php-fpm/Dockerfile-5.6debian
cp php-fpm/Dockerfile-7.2 php-fpm/Dockerfile-7.2debian
cp php-fpm/Dockerfile-7.4 php-fpm/Dockerfile-7.4debian
cp php-fpm/Dockerfile-8.0 php-fpm/Dockerfile-8.0debian
cp php-fpm/Dockerfile-8.1 php-fpm/Dockerfile-8.1debian
cp php-fpm/Dockerfile-8.2 php-fpm/Dockerfile-8.2debian
cp php-fpm/Dockerfile-8.3 php-fpm/Dockerfile-8.3debian
cp php-fpm/Dockerfile-multi php-fpm/Dockerfile-multidebian
sed -i s/"eilandert\/ubuntu-base:rolling"/"eilandert\/debian-base:stable"/ php-fpm/*debian
#sed -i s/"\#TEMPLATE3\#"/"echo \"deb \[trusted=yes\] http:\/\/packages.sury.org\/php\/ \${DIST} main\" > \/etc\/apt\/sources.list.d\/ondrej-ppa.list"/ php-fpm/Dockerfile-*debian
#sed -i s/"\#TEMPLATE3\#"/"echo \"deb \[trusted=yes\] http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ \${DIST} main\" > \/etc\/apt\/sources.list.d\/ondrej-ppa.list"/ php-fpm/Dockerfile-{5.6,7.2,7.4,8.0,8.1,8.2,8.3,multi}
####
## SCRIPTS Apache PHP-FPM
####
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-5.6
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-7.2
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-7.4
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-8.0
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-8.1
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-8.2
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-8.3
cp apache-phpfpm/Dockerfile-template apache-phpfpm/Dockerfile-multi
sed -i 's/#PHPVERSION#/5.6/' apache-phpfpm/Dockerfile-5.6
sed -i 's/#PHPVERSION#/7.2/' apache-phpfpm/Dockerfile-7.2
sed -i 's/#PHPVERSION#/7.4/' apache-phpfpm/Dockerfile-7.4
sed -i 's/#PHPVERSION#/8.0/' apache-phpfpm/Dockerfile-8.0
sed -i 's/#PHPVERSION#/8.1/' apache-phpfpm/Dockerfile-8.1
sed -i 's/#PHPVERSION#/8.2/' apache-phpfpm/Dockerfile-8.2
sed -i 's/#PHPVERSION#/8.3/' apache-phpfpm/Dockerfile-8.3
sed -i 's/#PHPVERSION#/multi/' apache-phpfpm/Dockerfile-multi
sed -i '/libapache2-mod-php/d' apache-phpfpm/Dockerfile-multi
sed -i '/a2enconf php/d' apache-phpfpm/Dockerfile-multi
sed -i '/a2dismod php/d' apache-phpfpm/Dockerfile-multi
cp apache-phpfpm/Dockerfile-5.6 apache-phpfpm/Dockerfile-5.6debian
cp apache-phpfpm/Dockerfile-7.2 apache-phpfpm/Dockerfile-7.2debian
cp apache-phpfpm/Dockerfile-7.4 apache-phpfpm/Dockerfile-7.4debian
cp apache-phpfpm/Dockerfile-8.0 apache-phpfpm/Dockerfile-8.0debian
cp apache-phpfpm/Dockerfile-8.1 apache-phpfpm/Dockerfile-8.1debian
cp apache-phpfpm/Dockerfile-8.2 apache-phpfpm/Dockerfile-8.2debian
cp apache-phpfpm/Dockerfile-8.3 apache-phpfpm/Dockerfile-8.3debian
cp apache-phpfpm/Dockerfile-multi apache-phpfpm/Dockerfile-multidebian
sed -i s/"eilandert\/php-fpm:"/"eilandert\/php-fpm:deb-"/ apache-phpfpm/*debian
####
## SCRIPT NGINX PROXY
###
cp nginx/Dockerfile.template nginx/Dockerfile
cp nginx/Dockerfile.template nginx/Dockerfile-php56
cp nginx/Dockerfile.template nginx/Dockerfile-php72
cp nginx/Dockerfile.template nginx/Dockerfile-php74
cp nginx/Dockerfile.template nginx/Dockerfile-php80
cp nginx/Dockerfile.template nginx/Dockerfile-php81
cp nginx/Dockerfile.template nginx/Dockerfile-php82
cp nginx/Dockerfile.template nginx/Dockerfile-php83
cp nginx/Dockerfile.template nginx/Dockerfile-multi
cp nginx/Dockerfile.template nginx/Dockerfile-debian
cp nginx/Dockerfile.template nginx/Dockerfile-php56debian
cp nginx/Dockerfile.template nginx/Dockerfile-php72debian
cp nginx/Dockerfile.template nginx/Dockerfile-php74debian
cp nginx/Dockerfile.template nginx/Dockerfile-php80debian
cp nginx/Dockerfile.template nginx/Dockerfile-php81debian
cp nginx/Dockerfile.template nginx/Dockerfile-php82debian
cp nginx/Dockerfile.template nginx/Dockerfile-php83debian
cp nginx/Dockerfile.template nginx/Dockerfile-multidebian
sed -i 's/#FROM#/eilandert\/ubuntu-base:rolling/' nginx/Dockerfile
sed -i 's/#FROM#/eilandert\/php-fpm:multi/' nginx/Dockerfile-multi
sed -i 's/#FROM#/eilandert\/php-fpm:5.6/' nginx/Dockerfile-php56
sed -i 's/#FROM#/eilandert\/php-fpm:7.2/' nginx/Dockerfile-php72
sed -i 's/#FROM#/eilandert\/php-fpm:7.4/' nginx/Dockerfile-php74
sed -i 's/#FROM#/eilandert\/php-fpm:8.0/' nginx/Dockerfile-php80
sed -i 's/#FROM#/eilandert\/php-fpm:8.1/' nginx/Dockerfile-php81
sed -i 's/#FROM#/eilandert\/php-fpm:8.2/' nginx/Dockerfile-php82
sed -i 's/#FROM#/eilandert\/php-fpm:8.3/' nginx/Dockerfile-php83
sed -i 's/#FROM#/eilandert\/debian-base:stable/' nginx/Dockerfile-debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-multi/' nginx/Dockerfile-multidebian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-5.6/' nginx/Dockerfile-php56debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-7.2/' nginx/Dockerfile-php72debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-7.4/' nginx/Dockerfile-php74debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-8.0/' nginx/Dockerfile-php80debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-8.1/' nginx/Dockerfile-php81debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-8.2/' nginx/Dockerfile-php82debian
sed -i 's/#FROM#/eilandert\/php-fpm:deb-8.3/' nginx/Dockerfile-php83debian
####
## SCRIPT ANGIE
###
cp nginx/Dockerfile* angie
cp nginx/bootstrap.sh angie
sed -i s/nginx/angie/g angie/Dockerfile*
sed -i s/nginx/angie/g angie/bootstrap.sh
sed -i s/NGINX/ANGIE/g angie/bootstrap.sh
export UBUNTU_ROLLING="jammy"
#SCRIPTS MARIADB
curl https://raw.githubusercontent.com/MariaDB/mariadb-docker/master/10.11/Dockerfile -o mariadb/Dockerfile.ubuntu
curl https://raw.githubusercontent.com/MariaDB/mariadb-docker/master/10.11/docker-entrypoint.sh -o mariadb/docker-entrypoint.sh
curl https://raw.githubusercontent.com/MariaDB/mariadb-docker/master/10.11/healthcheck.sh -o mariadb/healthcheck.sh
cp mariadb/Dockerfile.ubuntu mariadb/Dockerfile.debian
chmod +x mariadb/docker-entrypoint.sh
sed -i s/"FROM\ ubuntu:jammy"/"FROM\ eilandert\/ubuntu-base:rolling\nCOPY bootstrap.sh \/"/ mariadb/Dockerfile.ubuntu
sed -i s/"FROM\ ubuntu:jammy"/"FROM\ eilandert\/debian-base:stable\nCOPY bootstrap.sh \/"/ mariadb/Dockerfile.debian
sed -i s/"jammy"/"${UBUNTU_ROLLING}"/g mariadb/Dockerfile.ubuntu
sed -i s/"jammy"/"bookworm"/g mariadb/Dockerfile.debian
sed -i s/"repo\/ubuntu"/"repo\/debian"/g mariadb/Dockerfile.debian
sed -i s/"ENTRYPOINT \[\"docker-entrypoint.sh\"\]"/"ENTRYPOINT \[\"\/usr\/local\/bin\/docker-entrypoint.sh\"\]"/ mariadb/Dockerfile.*
sed -i s/"bin\/bash"/"bin\/bash\nbash \/bootstrap.sh"/ mariadb/docker-entrypoint.sh
sed -i s/"ubu2004"/"ubu2204"/g mariadb/Dockerfile.ubuntu
sed -i s/"ubu2204"/"deb12"/g mariadb/Dockerfile.debian
#commit upstream changes
git add mariadb/Dockerfile.debian
git add mariadb/Dockerfile.ubuntu
git add mariadb/docker-entrypoint.sh
git add mariadb/healthcheck.sh
git commit -m "Changes from upstream"
git push
#roundcube
#cp roundcube/Dockerfile-template roundcube/Dockerfile-debian
#cp roundcube/Dockerfile-template roundcube/Dockerfile-ubuntu
#sed -i s/"#TEMPLATE1#"/"eilandert\/apache-phpfpm:8\.3/" roundcube/Dockerfile-ubuntu
#sed -i s/"#TEMPLATE1#"/"eilandert\/apache-phpfpm:deb-8\.3"/ roundcube/Dockerfile-debian
LASTVERSION=$(lastversion -b 1.6 https://github.com/roundcube/roundcubemail/)
if [ "${LASTVERSION}" == "" ]; then
echo "LASTVERSION EMPTY"
else
echo ${LASTVERSION} > roundcube/.lastversion
fi