mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-23 04:05:26 +00:00
Compare commits
80 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 771951b38e | |||
| eccc989887 | |||
| c4aa105042 | |||
| ffcb76f73f | |||
| 9e8a924ac7 | |||
| b51813f026 | |||
| ee738da7d7 | |||
| 0314d0eb09 | |||
| 0855f76512 | |||
| e4733d1dca | |||
| c5950bf7d2 | |||
| ac1b8092e0 | |||
| aa0dd571b4 | |||
| 6381b0aded | |||
| b9a1434398 | |||
| cf032f7d7e | |||
| c5d032eeb7 | |||
| 2372cb93d3 | |||
| 375fb73586 | |||
| e14311318c | |||
| f3dd4f0123 | |||
| 102a3b54ba | |||
| 58de72c458 | |||
| 738bfd51d5 | |||
| 68662fd2ca | |||
| 6d80a9d123 | |||
| 765ac6072d | |||
| d9962dff26 | |||
| 9f19edf137 | |||
| b452514c36 | |||
| 4304c75595 | |||
| fd01947aaa | |||
| b890882e54 | |||
| 1764d0c0a4 | |||
| 5c79befd28 | |||
| 2b865723bf | |||
| 15840cef6c | |||
| ea80b658dc | |||
| 75759ded24 | |||
| 0cbb0aa0b5 | |||
| 0122b74815 | |||
| 1b4f26d2e8 | |||
| 5bf6013d6b | |||
| 428a7c1875 | |||
| 3ba8889194 | |||
| c144da4485 | |||
| 2a1f5b7500 | |||
| 1725a6ed14 | |||
| 8ab55e1ef3 | |||
| 32a5ab5138 | |||
| fb97af317e | |||
| fe758aab61 | |||
| 4c2868f6c9 | |||
| 919aff0080 | |||
| 8504cf7caf | |||
| 101a7486f2 | |||
| 80e576db2d | |||
| 3a73e47b83 | |||
| 62824051c8 | |||
| c4a2403943 | |||
| 2aad0a9407 | |||
| 6ead8c3cf0 | |||
| 3a18a19583 | |||
| f620b09134 | |||
| 2838251c67 | |||
| f7cff34527 | |||
| acdf8c35fa | |||
| c5f2bf1059 | |||
| 1f25fae04f | |||
| caffa2fd8d | |||
| 8de8eb3104 | |||
| 2d3fa3c09e | |||
| f7b3c77f78 | |||
| d968048ef5 | |||
| 6d26ca04be | |||
| 577eef3631 | |||
| 21d7fb476b | |||
| 4c3a329e31 | |||
| 6c94e49732 | |||
| af77b29509 |
+9
-10
@@ -1,4 +1,4 @@
|
||||
FROM adoptopenjdk:8-jdk-openj9
|
||||
FROM adoptopenjdk:11-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 files/sudoers* /etc/sudoers.d
|
||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||
|
||||
EXPOSE 25565 25575
|
||||
|
||||
@@ -78,15 +78,14 @@ 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 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
|
||||
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
|
||||
|
||||
RUN dos2unix /start* && chmod +x /start* \
|
||||
&& dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||
RUN dos2unix /start* /autopause/*
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=1m CMD mc-health
|
||||
|
||||
@@ -147,7 +147,7 @@ if [[ $tag ]]; then
|
||||
"generate_release_notes": true
|
||||
}
|
||||
EOF
|
||||
if ! echo curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
|
||||
if ! 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,6 +115,12 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
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 "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
@@ -127,6 +133,10 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FTB|CURSEFORGE)
|
||||
log "**********************************************************************"
|
||||
log "NOTE: Some mods and modpacks may require Java 8."
|
||||
log " If so, use itzg/minecraft-server:java8"
|
||||
log "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||
;;
|
||||
|
||||
@@ -171,6 +181,12 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
CRUCIBLE)
|
||||
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 "**********************************************************************"
|
||||
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
||||
;;
|
||||
|
||||
|
||||
+29
-22
@@ -107,7 +107,36 @@ 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
|
||||
@@ -150,28 +179,6 @@ 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