-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
45 lines (38 loc) · 1.22 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
FROM ich777/debian-baseimage
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-minecraft-basic-server"
RUN apt-get update && \
apt-get -y install --no-install-recommends screen curl jq unzip && \
rm -rf /var/lib/apt/lists/*
RUN wget -O /tmp/gotty.tar.gz https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz && \
tar -C /usr/bin/ -xvf /tmp/gotty.tar.gz && \
rm -rf /tmp/gotty.tar.gz
ENV DATA_DIR="/serverdata"
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV RUNTIME_NAME="jre17"
ENV JAR_NAME="server"
ENV GAME_V=""
ENV GAME_PARAMS=""
ENV GAME_PORT=25565
ENV ENABLE_WEBCONSOLE="true"
ENV GOTTY_PARAMS="-w --title-format MinecraftJavaEdition"
ENV XMX_SIZE=1024
ENV XMS_SIZE=1024
ENV EXTRA_JVM_PARAMS=""
ENV JVM_CUSTOM_COMMAND=""
ENV ACCEPT_EULA="false"
ENV UMASK=000
ENV UID=99
ENV GID=100
ENV USER="minecraft"
ENV DATA_PERM=770
RUN mkdir $DATA_DIR && \
mkdir $SERVER_DIR && \
useradd -d $DATA_DIR -s /bin/bash $USER && \
chown -R $USER $DATA_DIR && \
ulimit -n 2048
ADD /scripts/ /opt/scripts/
COPY /config/server.properties /tmp/server.properties
RUN chmod -R 770 /opt/scripts/
#Server Start
ENTRYPOINT ["/opt/scripts/start.sh"]