mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-22 03:35:25 +00:00
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52ac180c77 | |||
| 32195e71c5 | |||
| a0a578f452 | |||
| ca0ddc80aa | |||
| 1a625f09bb | |||
| 9ab345a727 | |||
| 4e3031cff8 | |||
| 466e1728f6 | |||
| 8dddbc4120 | |||
| 53e9d36a05 | |||
| 275c2d0c54 | |||
| cf9c40f331 | |||
| 491ffe49bf | |||
| d4a9b367c7 | |||
| 032d94a30f | |||
| 3784d2df54 | |||
| 8a36823843 | |||
| 78c520572a | |||
| 5303105265 | |||
| 1f120c5fa4 | |||
| 70ec3b838d | |||
| b248ed342f | |||
| 4c70184804 | |||
| b9ba062add | |||
| cbb1d0ea52 | |||
| bbad3a3e7a | |||
| 8965397a5a | |||
| c661fe7318 | |||
| bae1feb750 | |||
| edbcf80a70 | |||
| fb23e12680 | |||
| e30a2e6448 | |||
| 03d7babd68 | |||
| 332b929a6d | |||
| c138cabc65 | |||
| 41631e35e8 | |||
| 6f95fa6175 | |||
| 6f16da8309 | |||
| 8cee8d5618 | |||
| 8b76b5776a | |||
| e3af06d2e4 | |||
| 0ac583514c | |||
| bf3f15f5fb | |||
| 4aec2322b5 | |||
| 51b2eb6851 | |||
| 846050f41a | |||
| 485ec6a141 | |||
| 0096e41882 | |||
| d45610723a | |||
| 072704b54d | |||
| 0f08e88c5b | |||
| 89604c8d13 | |||
| 58842d444b | |||
| 457d09e14d | |||
| 7210e81f47 | |||
| ba86534e6e | |||
| 44bafbff09 | |||
| 75c51bf0c7 | |||
| cf651f2279 | |||
| 6d0d7fe19c | |||
| bb58d7a4c9 | |||
| 6efaac2861 | |||
| 806342d74b | |||
| 926e302595 | |||
| 10e85140ad | |||
| fc2ed9e612 | |||
| edfe58079a | |||
| d423cc3b8d | |||
| 1537e48e29 | |||
| 62473771dc | |||
| c4528e8f79 | |||
| 0f797487ab | |||
| 9511e3cc80 | |||
| 3aa4dd6c85 |
@@ -81,7 +81,7 @@ jobs:
|
||||
uses: docker/build-push-action@v2.7.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
platforms: linux/amd64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
# ensure latest base image is used
|
||||
|
||||
+10
-9
@@ -1,4 +1,4 @@
|
||||
FROM eclipse-temurin:8-jdk
|
||||
FROM adoptopenjdk:8-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
|
||||
|
||||
+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