-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 967 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (26 loc) · 967 Bytes
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
FROM bmoorman/ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive \
MC_SERVER_PORT=25565 \
MC_RCON_PORT=25575 \
TARGETOS \
TARGETARCH \
TARGETVARIANT
WORKDIR /var/lib/minecraft
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
openjdk-17-jre-headless \
jq \
unzip \
vim \
wget \
xgrep \
&& target=${TARGETOS}_${TARGETARCH}${TARGETVARIANT} \
&& fileUrl=$(curl --silent --location "https://api.github.com/repos/itzg/rcon-cli/releases/latest" | jq --arg target ${target} --raw-output '.assets[] | select(.name | endswith($target + ".tar.gz")) | .browser_download_url') \
&& curl --silent --location "${fileUrl}" | tar xz -C /usr/local/bin \
&& apt-get autoremove --yes --purge \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY minecraft/ /etc/minecraft/
VOLUME /var/lib/minecraft
EXPOSE ${MC_SERVER_PORT} ${MC_RCON_PORT}
CMD ["/etc/minecraft/start.sh"]