forked from j-brn/minecraft-tekxit-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (43 loc) · 1.66 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
FROM eclipse-temurin:17-jre-focal
ARG VERSION="12.0.0"
ENV USER=minecraft
ENV UID=1000
ENV JAVA_XMS=1G
ENV JAVA_XMX=4G
ENV JAVA_ADDITIONAL_ARGS=""
# Install necessary packages and clean up
RUN apt-get update && \
apt-get install -y unzip curl gosu && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download, setup rcon-cli, and clean up
RUN ARCH=$(uname -m) && \
case "$ARCH" in \
aarch64) ARCH="arm64" ;; \
x86_64) ARCH="amd64" ;; \
esac && \
LATEST_VERSION=$(curl -sSL https://api.github.com/repos/itzg/rcon-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && \
echo "LATEST_VERSION: ${LATEST_VERSION}" && \
echo "ARCH: ${ARCH}" && \
curl -sSL "https://github.com/itzg/rcon-cli/releases/download/${LATEST_VERSION}/rcon-cli_${LATEST_VERSION}_linux_${ARCH}.tar.gz" -o rcon-cli.tar.gz && \
tar -xzf rcon-cli.tar.gz rcon-cli && \
mv rcon-cli /usr/local/bin && \
rm rcon-cli.tar.gz
# Add entrypoint script
COPY ./scripts/entrypoint.sh /entrypoint
RUN chmod +x /entrypoint
# Create user, download and unpack Tekxit server files, and set up directories
RUN adduser --disabled-password --gecos "" --uid "${UID}" "${USER}" && \
mkdir /tekxit-server && \
chown -R "${USER}" /tekxit-server && \
curl -sSL "https://www.tekxit.lol/downloads/tekxit4/${VERSION}Tekxit4Server.zip" -o tekxit-server.zip && \
unzip tekxit-server.zip && \
mv ${VERSION}Tekxit4Server/* /tekxit-server && \
rmdir ${VERSION}Tekxit4Server && \
rm tekxit-server.zip
# Add update indicator
RUN touch /tekxit-server/update_indicator
WORKDIR /data
EXPOSE 25565
EXPOSE 25575
ENTRYPOINT ["/bin/bash", "/entrypoint"]