forked from linuxserver/docker-minetest
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
134 lines (128 loc) · 3.3 KB
/
Dockerfile
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
FROM lsiobase/alpine:3.10
# set version label
ARG BUILD_DATE
ARG VERSION
ARG MINETEST_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sparklyballs"
# environment variables
ENV HOME="/config" \
MINETEST_SUBGAME_PATH="/config/.minetest/games"
# build variables
ARG LDFLAGS="-lintl"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
bzip2-dev \
cmake \
curl-dev \
doxygen \
g++ \
gcc \
gettext-dev \
git \
gmp-dev \
hiredis-dev \
icu-dev \
irrlicht-dev \
libjpeg-turbo-dev \
libogg-dev \
libpng-dev \
libressl-dev \
libtool \
libvorbis-dev \
luajit-dev \
make \
mesa-dev \
openal-soft-dev \
python-dev \
sqlite-dev && \
apk add --no-cache --virtual=build-dependencies-2 \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
leveldb-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
gmp \
hiredis \
libgcc \
libintl \
libstdc++ \
luajit \
lua-socket \
sqlite \
sqlite-libs && \
apk add --no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
leveldb && \
echo "**** compile spatialindex ****" && \
git clone https://github.com/libspatialindex/libspatialindex /tmp/spatialindex && \
cd /tmp/spatialindex && \
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr && \
make -j 2 && \
make install && \
echo "**** compile minetestserver ****" && \
if [ -z ${MINETEST_RELEASE+x} ]; then \
MINETEST_RELEASE=$(curl -sX GET "https://api.github.com/repos/minetest/minetest/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/tmp/minetest && \
curl -o \
/tmp/minetest-src.tar.gz -L \
"https://github.com/minetest/minetest/archive/${MINETEST_RELEASE}.tar.gz" && \
tar xf \
/tmp/minetest-src.tar.gz -C \
/tmp/minetest --strip-components=1 && \
cp /tmp/minetest/minetest.conf.example /defaults/minetest.conf && \
cd /tmp/minetest && \
cmake . \
-DBUILD_CLIENT=0 \
-DBUILD_SERVER=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCUSTOM_BINDIR=/usr/bin \
-DCUSTOM_DOCDIR="/usr/share/doc/minetest" \
-DCUSTOM_SHAREDIR="/usr/share/minetest" \
-DENABLE_CURL=1 \
-DENABLE_FREETYPE=1 \
-DENABLE_GETTEXT=0 \
-DENABLE_LEVELDB=1 \
-DENABLE_LUAJIT=1 \
-DENABLE_REDIS=1 \
-DENABLE_SOUND=0 \
-DENABLE_SYSTEM_GMP=1 \
-DRUN_IN_PLACE=0 && \
make -j 2 && \
make install && \
echo "**** copy games to temporary folder ****" && \
mkdir -p \
/defaults/games && \
cp -pr /usr/share/minetest/games/* /defaults/games/ && \
echo "**** split after 3rd dot if it exists in minetest tag variable ****" && \
echo "**** so we fetch game version x.x.x etc ****" && \
if \
[ $(echo "$MINETEST_RELEASE" | tr -cd '.' | wc -c) = 3 ] ; \
then MINETEST_RELEASE=${MINETEST_RELEASE%.*}; \
fi && \
echo "**** fetch additional game ****" && \
mkdir -p \
/defaults/games/minetest && \
curl -o \
/tmp/minetest-game.tar.gz -L \
"https://github.com/minetest/minetest_game/archive/${MINETEST_RELEASE}.tar.gz" && \
tar xf \
/tmp/minetest-game.tar.gz -C \
/defaults/games/minetest --strip-components=1 && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
apk del --purge \
build-dependencies-2 && \
rm -rf \
/tmp/*
# add local files
COPY root /
# ports and volumes
EXPOSE 30000/udp
VOLUME /config/.minetest