Skip to content

Commit

Permalink
Added manual Minecraft Bedrock Server selection (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
aessing authored Jun 5, 2022
1 parent 1f87af2 commit e4a8ca7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 25 deletions.
47 changes: 23 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,38 @@ LABEL tag="aessing/minecraft-bedrock" \

###############################################################################
# Set parameters
ENV SERVER_NAME='Dedicated Server' \
GAMEMODE='survival' \
FORCE_GAMEMODE='false' \
ENV ALLOW_CHEATS='false' \
ALLOW_LIST='false' \
COMPRESSION_THRESHOLD='1' \
CONTENT_LOG_FILE='false' \
CORRECT_PLAYER_MOVEMENT='false' \
DEFAULT_PLAYER_PERMISSION_LEVEL='member' \
DIFFICULTY='easy' \
ALLOW_CHEATS='false' \
EMIT_SERVER_TELEMETRY='false' \
EULA='false' \
FORCE_GAMEMODE='false' \
GAMEMODE='survival' \
LEVEL_NAME='Bedrock level' \
LEVEL_SEED='' \
LEVEL_TYPE='DEFAULT' \
MAX_PLAYERS='10' \
MAX_THREADS='8' \
ONLINE_MODE='true' \
ALLOW_LIST='false' \
SERVER_PORT='19132' \
SERVER_PORTv6='19133' \
VIEW_DISTANCE='32' \
TICK_DISTANCE='4' \
PLAYER_IDLE_TIMEOUT='30' \
MAX_THREADS='8' \
LEVEL_NAME='Bedrock level' \
LEVEL_SEED='' \
DEFAULT_PLAYER_PERMISSION_LEVEL='member' \
TEXTUREPACK_REQUIRED='false' \
CONTENT_LOG_FILE='false' \
COMPRESSION_THRESHOLD='1' \
SERVER_AUTHORITATIVE_MOVEMENT='server-auth' \
PLAYER_MOVEMENT_SCORE_THRESHOLD='20' \
PLAYER_MOVEMENT_DISTANCE_THRESHOLD='0.3' \
PLAYER_MOVEMENT_DURATION_THRESHOLD='500' \
CORRECT_PLAYER_MOVEMENT='false' \
PLAYER_MOVEMENT_SCORE_THRESHOLD='20' \
SERVER_AUTHORITATIVE_BLOCK_BREAKING='false' \
LEVEL_TYPE='DEFAULT' \
EULA='false' \
EMIT_SERVER_TELEMETRY='false' \
SERVER_PATH='/srv/bedrock-server' \
SERVER_AUTHORITATIVE_MOVEMENT='server-auth' \
SERVER_NAME='Dedicated Server' \
SERVER_PORT='19132' \
SERVER_PORTv6='19133' \
TEXTUREPACK_REQUIRED='false' \
TICK_DISTANCE='4' \
VIEW_DISTANCE='32' \
CONFIG_PATH='/srv/bedrock-config' \
DATA_PATH='/srv/minecraft' \
DOWNLOAD_URL='https://www.minecraft.net/en-us/download/server/bedrock'
SERVER_PATH='/srv/bedrock-server'
ARG UIDGID='10999' \
USERGROUPNAME='minecraft'
EXPOSE ${SERVER_PORT}/udp \
Expand Down
26 changes: 25 additions & 1 deletion container-files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,37 @@ echo "# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE."
echo "# ============================================================================="
echo ""

###############################################################################
# Set some variables
DOWNLOAD_URL='https://www.minecraft.net/en-us/download/server/bedrock'
MINECRAFT_VERSION='1.18.31.04'

###############################################################################
# Install Minecraft if not exists
if ! [ -f "${SERVER_PATH}/bedrock_server" ]; then
echo ""
echo "- Installing Minecraft Bedrock Server from ${DOWNLOAD_URL}"
curl $(curl --user-agent "aessing/minecraft-bedrock-container" --header "accept-language:*" "${DOWNLOAD_URL}" | grep -Eoi '<a [^>]+>' | grep -i bin-linux | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./?=_%:-]*') --output /tmp/bedrock.zip

if [ -n "${MINECRAFT_VERSION}" ]; then
if curl --head --silent --fail "https://minecraft.azureedge.net/bin-linux/bedrock-server-${MINECRAFT_VERSION}.zip" 2> /dev/null; then
echo "- Installing Minecraft Bedrock Server version ${MINECRAFT_VERSION}"
curl "https://minecraft.azureedge.net/bin-linux/bedrock-server-${MINECRAFT_VERSION}.zip" --output /tmp/bedrock.zip
else
echo ""
echo "MINECRAFT VERSION DOES NOT EXIST ON DOWNLOAD SERVER"
echo "--------------------------------------------------------------------------------"
echo "This Minecraft Bedrocks Server Version does not exist."
echo "Please check https://minecraft.fandom.com/de/wiki/Bedrock_Dedicated_Server for "
echo "available versions."
echo "--------------------------------------------------------------------------------"
echo ""
#exit 1
fi
else
echo "- Installing latest Minecraft Bedrock Server version"
curl $(curl --user-agent "aessing/minecraft-bedrock-container" --header "accept-language:*" "${DOWNLOAD_URL}" | grep -Eoi '<a [^>]+>' | grep -i bin-linux | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./?=_%:-]*') --output /tmp/bedrock.zip
fi

unzip /tmp/bedrock.zip -d ${SERVER_PATH}
chmod 755 ${SERVER_PATH}/bedrock_server
rm /tmp/bedrock.zip
Expand Down

0 comments on commit e4a8ca7

Please sign in to comment.