-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·71 lines (59 loc) · 1.98 KB
/
build
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
#!/bin/sh
function start()
{
docker volume rm images &>/dev/null
docker volume rm skins &>/dev/null
docker volume rm extensions &>/dev/null
docker rm -f mediawiki-hml &>/dev/null
docker rmi -f mediawiki-img &>/dev/null
cat >Dockerfile <<EOF
FROM mediawiki:latest
RUN apt update && apt upgrade -y
RUN apt install -y libldap2-dev tar
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu
RUN docker-php-ext-install ldap
WORKDIR /
COPY . .
RUN tar xzf extensions/mediawiki-extensions-LDAPAuthentication2-2.0.0.tar.gz -C /var/www/html/extensions
RUN tar xzf extensions/mediawiki-extensions-LDAPProvider-2.0.0.tar.gz -C /var/www/html/extensions
RUN tar xzf extensions/MobileFrontend-REL1_40-6d77c0b.tar.gz -C /var/www/html/extensions
RUN tar xzf extensions/PluggableAuth-REL1_40-764e1ec.tar.gz -C /var/www/html/extensions
RUN tar xzf skins/Foreground-REL1_40-cd870ce.tar.gz -C /var/www/html/skins
RUN tar xzf skins/Vector-REL1_40-31f26e6.tar.gz -C /var/www/html/skins
WORKDIR /var/www/html/extensions
RUN mv mediawiki-extensions-LDAPAuthentication2-2.0.0 LDAPAuthentication2
RUN mv mediawiki-extensions-LDAPProvider-2.0.0 LDAPProvider
COPY /LocalSettings.php /var/www/html
EOF
docker build -t mediawiki-img .
# declare +i mediawiki_base="/dados-hml/wiki/mediawiki"
declare +i mediawiki_base="/home/igor/repos/mediawiki"
docker volume create \
--driver local \
--opt type=nfs \
--opt o=addr=localhost,rw \
--opt device=:$mediawiki_base/images \
images
docker volume create \
--driver local \
--opt type=nfs \
--opt o=addr=localhost,rw \
--opt device=:$mediawiki_base/skins \
skins
docker run -d \
--name mediawiki-hml \
--publish 8080:80 \
-v skins:/var/www/html/skins \
-v images:/var/www/html/images \
mediawiki-img
# docker cp $mediawiki_base/LocalSettings.php mediawiki-hml:/var/www/html
}
function remove()
{
docker rm -f mediawiki-hml
}
if [ "$1" == "r" ];then
remove
elif [ "$1" == "s" ];then
start
fi