forked from Roemer/bedrock-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (33 loc) · 1.64 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
FROM ubuntu:22.04
ARG BDS_Version=1.20.41.02
ENV VERSION=$BDS_Version
# Install dependencies
RUN apt update && \
apt install -y unzip curl libcurl4 libssl3 && \
rm -rf /var/lib/apt/lists/*
# Download and extract the bedrock server
RUN if [ "$VERSION" = "latest" ] ; then \
LATEST_VERSION=$( \
curl -v --silent https://www.minecraft.net/en-us/download/server/bedrock/ 2>&1 | \
grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | \
sed 's#.*/bedrock-server-##' | sed 's/.zip//') && \
export VERSION=$LATEST_VERSION && \
echo "Setting VERSION to $LATEST_VERSION" ; \
else echo "Using VERSION of $VERSION"; \
fi && \
curl https://minecraft.azureedge.net/bin-linux/bedrock-server-${VERSION}.zip --output bedrock-server.zip && \
unzip bedrock-server.zip -d bedrock-server && \
rm bedrock-server.zip
# Create a separate folder for configurations move the original files there and create links for the files
RUN mkdir -p /bedrock-server/config && \
mv /bedrock-server/server.properties /bedrock-server/config && \
mv /bedrock-server/permissions.json /bedrock-server/config && \
mv /bedrock-server/allowlist.json /bedrock-server/config && \
ln -s /bedrock-server/config/server.properties /bedrock-server/server.properties && \
ln -s /bedrock-server/config/permissions.json /bedrock-server/permissions.json && \
ln -s /bedrock-server/config/allowlist.json /bedrock-server/allowlist.json
EXPOSE 19132/udp
VOLUME /bedrock-server/worlds /bedrock-server/config
WORKDIR /bedrock-server
ENV LD_LIBRARY_PATH=.
CMD ./bedrock_server