This repository was archived by the owner on Jan 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.3 KB
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
ARG JAVA_VERSION_PREFIX=8
ARG JAVA_VERSION_SUFFIX=-jre
ARG SIGTERM_PLUGIN_VERSION=1.0.0
FROM maven:3.6.3-openjdk-${JAVA_VERSION_PREFIX} as builder
ARG JAVA_VERSION_PREFIX
ARG JAVA_VERSION_SUFFIX
ARG SIGTERM_PLUGIN_VERSION
RUN apt-get update && apt-get install -y --no-install-recommends \
git gcc libc-dev
WORKDIR /sigterm-plugin-build
RUN git clone -b ${SIGTERM_PLUGIN_VERSION} https://github.com/Tabinol/sigterm-minecraft-plugin.git .
RUN mvn package
WORKDIR /su-exec
RUN set -ex
RUN curl -o /su-exec/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c
RUN gcc -Wall /su-exec/su-exec.c -o/su-exec/su-exec
FROM openjdk:${JAVA_VERSION_PREFIX}${JAVA_VERSION_SUFFIX}
ARG SIGTERM_PLUGIN_VERSION
ENV SIGTERM_PLUGIN_VERSION=${SIGTERM_PLUGIN_VERSION}
RUN apt-get update && apt-get install -y \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /su-exec/su-exec /usr/local/bin/su-exec
RUN chmod +x /usr/local/bin/su-exec
RUN mkdir -p /opt/minecraft-server-utils
COPY --from=builder /sigterm-plugin-build/target/sigterm-${SIGTERM_PLUGIN_VERSION}.jar /opt/minecraft-server-utils
ADD entrypoint.sh /opt/bin/entrypoint.sh
RUN chmod +x /opt/bin/entrypoint.sh
VOLUME [ "/opt/minecraft-server-jar", "/opt/minecraft-server" ]
EXPOSE 25565/tcp
ENTRYPOINT ["/opt/bin/entrypoint.sh"]