-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
87 lines (77 loc) · 2.28 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
FROM busybox
COPY *.sh /target/usr/local/bin/
RUN chmod +x /target/usr/local/bin/*
###
FROM debian:11
# Add "app" user
RUN mkdir -p /tmp/empty \
&& groupadd -g 9999 app \
&& useradd -d /data -l -N -g app -m -k /tmp/empty -u 9999 app \
&& rmdir /tmp/empty
# Prepare data volume
RUN mkdir -p /data && chown app:app /data
WORKDIR /data
ARG TS3SERVER_VERSION="3.13.7"
# Possible values are alpine, amd64, x86
ARG TS3SERVER_VARIANT="amd64"
ARG TS3SERVER_URL="https://files.teamspeak-services.com/releases/server/${TS3SERVER_VERSION}/teamspeak3-server_linux_${TS3SERVER_VARIANT}-${TS3SERVER_VERSION}.tar.bz2"
ARG TS3SERVER_SHA256="775a5731a9809801e4c8f9066cd9bc562a1b368553139c1249f2a0740d50041e"
ARG TS3SERVER_TAR_ARGS="-j"
ENV TS3SERVER_INSTALL_DIR="/opt/ts3server"
# Set up server
ADD ${TS3SERVER_URL} "/ts3server.tar.bz2"
RUN \
export INITRD=no \
&& export DEBIAN_FRONTEND=noninteractive \
\
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libmariadb3 \
tar \
bzip2 \
gzip \
xz-utils \
&& apt-mark auto \
tar \
bzip2 \
gzip \
xz-utils \
\
&& ( \
[ ! -z "${TS3SERVER_SHA256}" ] \
&& TS3SERVER_ACTUAL_SHA256="$(sha256sum /ts3server.tar.bz2 | awk '{print $1}')" \
&& if [ "${TS3SERVER_ACTUAL_SHA256}" != "${TS3SERVER_SHA256}" ]; then \
echo "Invalid checksum: ${TS3SERVER_ACTUAL_SHA256} != ${TS3SERVER_SHA256}" >&2; \
exit 1; \
fi \
) || ( \
echo "No hash configured!" \
&& exit 1 \
) \
\
&& mkdir -vp "${TS3SERVER_INSTALL_DIR}" \
&& tar -v -C "${TS3SERVER_INSTALL_DIR}" -xf /ts3server.tar.bz2 --strip 1 \
${TS3SERVER_TAR_ARGS} teamspeak3-server_linux_${TS3SERVER_VARIANT}/ \
&& rm -vfr \
/ts3server.tar.bz2 \
"${TS3SERVER_INSTALL_DIR}"/*.sh \
"${TS3SERVER_INSTALL_DIR}"/CHANGELOG \
"${TS3SERVER_INSTALL_DIR}"/doc \
"${TS3SERVER_INSTALL_DIR}"/redist \
"${TS3SERVER_INSTALL_DIR}"/tsdns \
&& chown -v root:root -R "${TS3SERVER_INSTALL_DIR}" \
&& chmod -v g-w,o-w -R "${TS3SERVER_INSTALL_DIR}" \
\
&& ln -vs ${TS3SERVER_INSTALL_DIR}/ts3server /usr/local/bin/ts3server \
\
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -vfr \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/*
COPY --from=0 /target/ /
USER app
ENTRYPOINT [ "docker-ts3server-entrypoint.sh" ]
EXPOSE 9987/udp 10011 10022 10080 10443 30033 41144