mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-23 04:05:26 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51fc8e824d | |||
| aff9031284 | |||
| 397d080da2 | |||
| cb5d052829 | |||
| 0908d21bed | |||
| 4d878985d4 | |||
| 72d7d4a65e | |||
| cb0add3b90 | |||
| 71a48ce10f |
+1
-2
@@ -1,11 +1,10 @@
|
|||||||
FROM ubuntu:18.04
|
FROM adoptopenjdk:latest
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
openjdk-8-jre-headless \
|
|
||||||
imagemagick \
|
imagemagick \
|
||||||
gosu \
|
gosu \
|
||||||
curl wget \
|
curl wget \
|
||||||
|
|||||||
+43
-55
@@ -4,66 +4,54 @@
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
if [[ $PAPER_DOWNLOAD_URL ]]; then
|
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
||||||
export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}")
|
|
||||||
|
|
||||||
if [ -f "$SERVER" ]; then
|
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||||
zarg=(-z "$SERVER")
|
| jq '.builds[-1]')
|
||||||
fi
|
case $? in
|
||||||
|
0)
|
||||||
echo "Preparing custom PaperMC jar from $PAPER_DOWNLOAD_URL"
|
;;
|
||||||
|
22)
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" "${PAPER_DOWNLOAD_URL}"
|
versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json")
|
||||||
else
|
if [[ $VERSION = LATEST ]]; then
|
||||||
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
||||||
|
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
||||||
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
# re-execute the current script with the newly computed version
|
||||||
| jq '.builds[-1]')
|
exec $0 "$@"
|
||||||
case $? in
|
fi
|
||||||
0)
|
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
||||||
;;
|
log " Set VERSION to one of the following: "
|
||||||
22)
|
log " $(echo "$versions" | jq -r '.versions | join(", ")')"
|
||||||
versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json")
|
|
||||||
if [[ $VERSION = LATEST ]]; then
|
|
||||||
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
|
||||||
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
|
||||||
# re-execute the current script with the newly computed version
|
|
||||||
exec $0 "$@"
|
|
||||||
fi
|
|
||||||
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
|
||||||
log " Set VERSION to one of the following: "
|
|
||||||
log " $(echo "$versions" | jq -r '.versions | join(", ")')"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
|
*)
|
||||||
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
|
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
|
||||||
| jq -r '.downloads.application.name')
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "$SERVER" ]; then
|
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
|
||||||
zarg=(-z "$SERVER")
|
| jq -r '.downloads.application.name')
|
||||||
fi
|
if [ $? != 0 ]; then
|
||||||
|
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
if [ -f "$SERVER" ]; then
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
zarg=(-z "$SERVER")
|
||||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
fi
|
||||||
-H "accept: application/java-archive"
|
|
||||||
if [ $? != 0 ]; then
|
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||||
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
|
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||||
exit 1
|
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||||
fi
|
-H "accept: application/java-archive"
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize on Spigot for downstream operations
|
# Normalize on Spigot for downstream operations
|
||||||
|
|||||||
Reference in New Issue
Block a user