mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-08 23:17:58 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32abf1614f | ||
|
|
f613228619 | ||
|
|
a916cc8320 |
+2
-1
@@ -1,10 +1,11 @@
|
|||||||
FROM adoptopenjdk:latest
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
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 \
|
||||||
|
|||||||
+26
-14
@@ -4,11 +4,22 @@
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
if [[ $PAPER_DOWNLOAD_URL ]]; then
|
||||||
|
export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}")
|
||||||
|
|
||||||
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
if [ -f "$SERVER" ]; then
|
||||||
|
zarg=(-z "$SERVER")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Preparing custom PaperMC jar from $PAPER_DOWNLOAD_URL"
|
||||||
|
|
||||||
|
curl -fsSL -o "$SERVER" "${zarg[@]}" "${PAPER_DOWNLOAD_URL}"
|
||||||
|
else
|
||||||
|
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
||||||
|
|
||||||
|
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||||
| jq '.builds[-1]')
|
| jq '.builds[-1]')
|
||||||
case $? in
|
case $? in
|
||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
22)
|
22)
|
||||||
@@ -28,30 +39,31 @@ case $? in
|
|||||||
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
|
echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
|
echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
|
export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \
|
||||||
| jq -r '.downloads.application.name')
|
| jq -r '.downloads.application.name')
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
|
echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$SERVER" ]; then
|
if [ -f "$SERVER" ]; then
|
||||||
zarg=(-z "$SERVER")
|
zarg=(-z "$SERVER")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||||
-H "accept: application/java-archive"
|
-H "accept: application/java-archive"
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
|
echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize on Spigot for downstream operations
|
# Normalize on Spigot for downstream operations
|
||||||
|
|||||||
Reference in New Issue
Block a user