mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-21 11:25:22 +00:00
Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e1c9261d1 | |||
| acc7c0568a | |||
| 3b0f82fedd | |||
| ac234ae658 | |||
| 0f9d81e5f1 | |||
| 7072f5dc91 | |||
| 9b155f2496 | |||
| add00ad38d | |||
| a3cff3ce88 | |||
| 601d587927 | |||
| e195a38faa | |||
| e704348630 | |||
| 893f6754f0 | |||
| f137251e22 | |||
| 869f167c0c | |||
| 3d7107bdbd | |||
| bce01eb1a2 | |||
| c5d1b655ce | |||
| 529e9fd058 | |||
| 905768d050 | |||
| 0dd0199d5c | |||
| 925a63f035 | |||
| f4be04ceb4 | |||
| db4594b3b3 | |||
| bfd4e6247c | |||
| 4e31acb896 | |||
| 78e4ecc1d7 | |||
| a2251f23e1 | |||
| 6ef0da9a63 | |||
| 4321d2a7e6 | |||
| 639e0264c2 | |||
| 1c4db94b1b | |||
| f0cebe526a | |||
| 20b1477672 | |||
| c4b4997fac | |||
| d442f164ba | |||
| 34d4385ea6 | |||
| cc84e65979 | |||
| 6f5fcc42f9 | |||
| 071621b54a | |||
| 230a64af1b | |||
| 1f980edeb1 | |||
| 649263290f | |||
| 990de92dd7 | |||
| 4f15c244b2 | |||
| 5f9c8f53e4 | |||
| 57fee8b46d | |||
| 79face2d60 | |||
| ceec69391c | |||
| dfa5add6ba | |||
| 02677ce1e2 | |||
| 2902e13c61 | |||
| 6d01021a30 | |||
| 07ded28d20 | |||
| a2d79fb85b | |||
| ecf9a090b1 | |||
| 17a3aa8079 | |||
| 14fb905ec1 | |||
| 8629bf5cb5 | |||
| f05891e475 | |||
| f1453dd4c1 | |||
| 22b560ba5d | |||
| e3acafee2f | |||
| 03df627881 | |||
| d87e5bdaa2 | |||
| 2543a5417c | |||
| 614f6a4be0 | |||
| fe9735d8c1 | |||
| 10dcbe7b03 | |||
| 85103cd8cf | |||
| 12915b04b7 | |||
| fbc8f72a22 | |||
| 7229c40202 | |||
| 581b514970 | |||
| d030daf354 | |||
| 98e6adbe1a | |||
| b94cfc44a0 | |||
| 8a9e85fb17 | |||
| 8a39719427 | |||
| 4100aa1f61 | |||
| 4d5fe0a03b | |||
| 236bb565ce | |||
| 7608168823 | |||
| acabb9d93c | |||
| 4e9c00c4d5 | |||
| f3826422cf | |||
| 9b7459ad5c | |||
| c9dc6012f6 | |||
| a5aec72837 | |||
| af38a8fc7a | |||
| 58fa3c897d | |||
| e45621d8e2 |
+10
-9
@@ -1,4 +1,4 @@
|
||||
FROM adoptopenjdk:11-jdk-openj9
|
||||
FROM adoptopenjdk:16-jdk-openj9
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
@@ -26,7 +26,7 @@ RUN apt-get update \
|
||||
RUN addgroup --gid 1000 minecraft \
|
||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||
|
||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||
COPY files/sudoers* /etc/sudoers.d
|
||||
|
||||
EXPOSE 25565 25575
|
||||
|
||||
@@ -78,14 +78,15 @@ ENV UID=1000 GID=1000 \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
||||
|
||||
COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
COPY --chmod=755 bin/mc-health /health.sh
|
||||
COPY --chmod=644 files/server.properties /tmp/server.properties
|
||||
COPY --chmod=644 files/log4j2.xml /tmp/log4j2.xml
|
||||
COPY --chmod=755 files/autopause /autopause
|
||||
COPY scripts/start* /
|
||||
COPY bin/ /usr/local/bin/
|
||||
COPY bin/mc-health /health.sh
|
||||
COPY files/server.properties /tmp/server.properties
|
||||
COPY files/log4j2.xml /tmp/log4j2.xml
|
||||
COPY files/autopause /autopause
|
||||
|
||||
RUN dos2unix /start* /autopause/*
|
||||
RUN dos2unix /start* && chmod +x /start* \
|
||||
&& dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=1m CMD mc-health
|
||||
|
||||
@@ -147,7 +147,7 @@ if [[ $tag ]]; then
|
||||
"generate_release_notes": true
|
||||
}
|
||||
EOF
|
||||
if ! curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
|
||||
if ! echo curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
|
||||
"${base}/repos/${owner}/${repo}/releases" -d "$releaseBody"; then
|
||||
echo "ERROR failed to create github release $tag"
|
||||
exit 1
|
||||
|
||||
@@ -115,12 +115,14 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
if versionLessThan 1.17; then
|
||||
log "**********************************************************************"
|
||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||
log " since some mods require Java 8"
|
||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||
log " can be fixed with java8"
|
||||
log "**********************************************************************"
|
||||
fi
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
|
||||
+22
-29
@@ -107,36 +107,7 @@ if [ -n "$ICON" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
canUseRollingLogs=true
|
||||
|
||||
patchLog4jConfig() {
|
||||
file=${1?}
|
||||
url=${2?}
|
||||
if ! get -o "$file" "$url"; then
|
||||
log "ERROR: failed to download corrected log4j config"
|
||||
exit 1
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
|
||||
canUseRollingLogs=false
|
||||
}
|
||||
|
||||
# Patch Log4j remote code execution vulnerability
|
||||
# See https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition
|
||||
if versionLessThan 1.7; then
|
||||
: # No patch required here.
|
||||
elif isFamily VANILLA && versionLessThan 1.12; then
|
||||
patchLog4jConfig log4j2_17-111.xml https://launcher.mojang.com/v1/objects/dd2b723346a8dcd48e7f4d245f6bf09e98db9696/log4j2_17-111.xml
|
||||
elif isFamily VANILLA && versionLessThan 1.17; then
|
||||
patchLog4jConfig log4j2_112-116.xml https://launcher.mojang.com/v1/objects/02937d122c86ce73319ef9975b58896fc1b491d1/log4j2_112-116.xml
|
||||
elif versionLessThan 1.18.1; then
|
||||
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
||||
if ! ${canUseRollingLogs}; then
|
||||
log "ERROR: Using rolling logs is currently not possible in the selected version due to CVE-2021-44228"
|
||||
exit 1
|
||||
fi
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
@@ -179,6 +150,28 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
patchLog4jConfig() {
|
||||
file=${1?}
|
||||
url=${2?}
|
||||
if ! get -o "$file" "$url"; then
|
||||
log "ERROR: failed to download corrected log4j config"
|
||||
exit 1
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=${file} ${JVM_OPTS}"
|
||||
}
|
||||
|
||||
# Patch Log4j remote code execution vulnerability
|
||||
# See https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition
|
||||
if versionLessThan 1.7; then
|
||||
: # No patch required here.
|
||||
elif isFamily VANILLA && versionLessThan 1.12; then
|
||||
patchLog4jConfig log4j2_17-111.xml https://launcher.mojang.com/v1/objects/dd2b723346a8dcd48e7f4d245f6bf09e98db9696/log4j2_17-111.xml
|
||||
elif isFamily VANILLA && versionLessThan 1.17; then
|
||||
patchLog4jConfig log4j2_112-116.xml https://launcher.mojang.com/v1/objects/02937d122c86ce73319ef9975b58896fc1b491d1/log4j2_112-116.xml
|
||||
elif versionLessThan 1.18.1; then
|
||||
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_JMX}; then
|
||||
: ${JMX_PORT:=7091}
|
||||
JVM_OPTS="${JVM_OPTS}
|
||||
|
||||
Reference in New Issue
Block a user