Compare commits

..

76 Commits

Author SHA1 Message Date
Geoff Bourne
9e8a924ac7 Auto-merging via docker-versions-create 2021-12-11 16:25:04 -06:00
Geoff Bourne
b51813f026 Auto-merging via docker-versions-create 2021-12-10 21:05:02 -06:00
Geoff Bourne
ee738da7d7 Auto-merging via docker-versions-create 2021-12-10 10:42:46 -06:00
Geoff Bourne
0314d0eb09 Auto-merging via docker-versions-create 2021-12-10 07:58:00 -06:00
Geoff Bourne
0855f76512 Auto-merging via docker-versions-create 2021-12-06 22:06:35 -06:00
Geoff Bourne
e4733d1dca Auto-merging via docker-versions-create 2021-12-04 10:00:34 -06:00
Geoff Bourne
c5950bf7d2 Auto-merging via docker-versions-create 2021-12-02 19:47:18 -06:00
Geoff Bourne
ac1b8092e0 Auto-merging via docker-versions-create 2021-11-24 15:58:04 -06:00
Geoff Bourne
aa0dd571b4 Auto-merging via docker-versions-create 2021-11-24 14:34:51 -06:00
Geoff Bourne
6381b0aded Track latest from master 2021-11-16 19:02:41 -06:00
Geoff Bourne
b9a1434398 Auto-merging via docker-versions-create 2021-11-16 18:52:20 -06:00
Geoff Bourne
cf032f7d7e Auto-merging via docker-versions-create 2021-11-15 20:48:55 -06:00
Geoff Bourne
c5d032eeb7 Auto-merging via docker-versions-create 2021-11-13 19:18:19 -06:00
Geoff Bourne
2372cb93d3 Auto-merging via docker-versions-create 2021-11-13 18:52:52 -06:00
Geoff Bourne
375fb73586 Auto-merging via docker-versions-create 2021-11-12 21:24:41 -06:00
Geoff Bourne
e14311318c Auto-merging via docker-versions-create 2021-11-06 21:39:21 -05:00
Geoff Bourne
f3dd4f0123 Auto-merging via docker-versions-create 2021-11-04 21:06:04 -05:00
Geoff Bourne
102a3b54ba Auto-merging via docker-versions-create 2021-10-31 09:47:33 -05:00
Geoff Bourne
58de72c458 Switched base image to JDK
#1064
2021-10-27 21:27:04 -05:00
Geoff Bourne
738bfd51d5 Merge branch 'master' into java11-openj9 2021-10-27 21:26:47 -05:00
Geoff Bourne
68662fd2ca Auto-merging via docker-versions-create 2021-10-25 19:25:03 -05:00
Geoff Bourne
6d80a9d123 Auto-merging via docker-versions-create 2021-10-24 20:29:45 -05:00
Geoff Bourne
765ac6072d Auto-merging via docker-versions-create 2021-10-23 09:45:24 -05:00
Geoff Bourne
d9962dff26 Auto-merging via docker-versions-create 2021-10-22 15:55:42 -05:00
Geoff Bourne
9f19edf137 Auto-merging via docker-versions-create 2021-10-18 22:15:38 -05:00
Geoff Bourne
b452514c36 Auto-merging via docker-versions-create 2021-10-17 14:54:22 -05:00
Geoff Bourne
4304c75595 Auto-merging via docker-versions-create 2021-10-15 18:58:53 -05:00
Geoff Bourne
fd01947aaa Auto-merging via docker-versions-create 2021-10-15 18:49:34 -05:00
Geoff Bourne
b890882e54 Auto-merging via docker-versions-create 2021-10-10 09:57:54 -05:00
Geoff Bourne
1764d0c0a4 Auto-merging via docker-versions-create 2021-10-09 15:27:02 -05:00
Geoff Bourne
5c79befd28 Auto-merging via docker-versions-create 2021-10-09 12:05:38 -05:00
Geoff Bourne
2b865723bf Auto-merging via docker-versions-create 2021-10-02 19:23:38 -05:00
Geoff Bourne
15840cef6c Auto-merging via docker-versions-create 2021-09-29 10:27:04 -05:00
Geoff Bourne
ea80b658dc Auto-merging via docker-versions-create 2021-09-27 20:42:22 -05:00
Geoff Bourne
75759ded24 Auto-merging via docker-versions-create 2021-09-20 12:31:47 -05:00
Geoff Bourne
0cbb0aa0b5 Auto-merging via docker-versions-create 2021-09-15 21:32:22 -05:00
Geoff Bourne
0122b74815 Auto-merging via docker-versions-create 2021-09-15 21:08:24 -05:00
Geoff Bourne
1b4f26d2e8 Auto-merging via docker-versions-create 2021-09-15 20:38:19 -05:00
Geoff Bourne
5bf6013d6b Auto-merging via docker-versions-create 2021-08-30 21:38:48 -05:00
Geoff Bourne
428a7c1875 Auto-merging via docker-versions-create 2021-08-10 12:57:13 -05:00
Geoff Bourne
3ba8889194 Auto-merging via docker-versions-create 2021-08-01 12:14:17 -05:00
Geoff Bourne
c144da4485 Auto-merging via docker-versions-create 2021-07-31 09:28:40 -05:00
Geoff Bourne
2a1f5b7500 Auto-merging via docker-versions-create 2021-07-26 19:36:39 -05:00
Geoff Bourne
1725a6ed14 Merge branch 'master' into java11-openj9 2021-07-25 18:21:40 -05:00
Geoff Bourne
8ab55e1ef3 Auto-merging via docker-versions-create 2021-07-25 09:37:56 -05:00
Geoff Bourne
32a5ab5138 Auto-merging via docker-versions-create 2021-07-23 21:28:41 -05:00
Geoff Bourne
fb97af317e Auto-merging via docker-versions-create 2021-07-17 21:15:45 -05:00
Geoff Bourne
fe758aab61 Auto-merging via docker-versions-create 2021-07-17 20:58:31 -05:00
Geoff Bourne
4c2868f6c9 Auto-merging via docker-versions-create 2021-07-17 18:05:20 -05:00
Geoff Bourne
919aff0080 Auto-merging via docker-versions-create 2021-07-14 18:43:24 -05:00
Geoff Bourne
8504cf7caf Auto-merging via docker-versions-create 2021-07-12 19:10:45 -05:00
Geoff Bourne
101a7486f2 Auto-merging via docker-versions-create 2021-07-09 19:59:30 -05:00
Geoff Bourne
80e576db2d Auto-merging via docker-versions-create 2021-07-08 18:00:48 -05:00
Geoff Bourne
3a73e47b83 Auto-merging via docker-versions-create 2021-07-08 08:04:52 -05:00
itzg
62824051c8 Auto-merging via docker-versions-create 2021-07-08 12:56:06 +00:00
Geoff Bourne
c4a2403943 Auto-merging via docker-versions-create 2021-07-08 07:39:53 -05:00
itzg
2aad0a9407 Auto-merging via docker-versions-create 2021-07-04 19:54:06 +00:00
Geoff Bourne
6ead8c3cf0 Auto-merging from master 2021-07-03 14:25:28 -05:00
Geoff Bourne
3a18a19583 ci: auto-merge from master 2021-07-02 16:01:23 -05:00
itzg
f620b09134 Auto-merging via docker-versions-create 2021-07-02 16:56:00 +00:00
itzg
2838251c67 Auto-merging via docker-versions-create 2021-06-28 12:14:11 +00:00
itzg
f7cff34527 Auto-merging via docker-versions-create 2021-06-27 13:13:17 +00:00
itzg
acdf8c35fa Auto-merging via docker-versions-create 2021-06-24 12:47:11 +00:00
Geoff Bourne
c5f2bf1059 Auto-merging via docker-versions-create 2021-06-23 22:34:57 -05:00
Geoff Bourne
1f25fae04f Auto-merging via docker-versions-create 2021-06-20 12:49:56 -05:00
Geoff Bourne
caffa2fd8d Auto-merging via docker-versions-create 2021-06-05 17:53:21 -05:00
Geoff Bourne
8de8eb3104 Auto-merging via docker-versions-create 2021-05-24 20:52:01 -05:00
Geoff Bourne
2d3fa3c09e Merge branch 'master' into java11-openj9 2021-05-23 12:27:10 -05:00
Geoff Bourne
f7b3c77f78 Merge from master 2021-05-22 13:46:22 -05:00
Geoff Bourne
d968048ef5 Auto-merging via docker-versions-create 2021-05-21 23:02:53 -05:00
Geoff Bourne
6d26ca04be Auto-merging via docker-versions-create 2021-05-21 22:50:55 -05:00
Geoff Bourne
577eef3631 Merge branch 'master' into java11-openj9
# Conflicts:
#	.github/workflows/build-multiarch.yml
#	docker-versions-create.sh
2021-05-21 22:41:16 -05:00
Geoff Bourne
21d7fb476b ci: added java11-openj9 branch 2021-05-21 22:37:40 -05:00
Geoff Bourne
4c3a329e31 ci: adjusted CACHE_NAME 2021-05-21 17:34:05 -05:00
Geoff Bourne
6c94e49732 ci: updated java11 Dockerfile 2021-05-21 17:33:26 -05:00
Geoff Bourne
af77b29509 ci: add java11 to build/merge 2021-05-21 17:32:38 -05:00
12 changed files with 82 additions and 70 deletions

View File

@@ -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

View File

@@ -1,39 +1,40 @@
FROM openjdk:8-jdk-alpine
FROM adoptopenjdk:11-jdk-openj9
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
RUN apk add --no-cache -U \
openssl \
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
lsof \
su-exec \
shadow \
bash \
curl iputils wget \
gosu \
sudo \
net-tools \
iputils-ping \
curl wget \
git \
jq \
dos2unix \
mysql-client \
tzdata \
rsync \
nano \
sudo \
knock \
ttf-dejavu
unzip \
knockd \
ttf-dejavu \
&& apt-get clean
RUN addgroup -g 1000 minecraft \
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
&& mkdir -m 777 /data \
&& chown minecraft:minecraft /data /home/minecraft
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
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETVARIANT=""
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
@@ -71,20 +72,21 @@ WORKDIR /data
STOPSIGNAL SIGTERM
ENV UID=1000 GID=1000 \
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
MEMORY="1G" \
TYPE=VANILLA VERSION=LATEST \
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
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

View File

@@ -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

View File

@@ -5,15 +5,15 @@ current_uptime() {
}
java_running() {
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
}
java_process_exists() {
[[ -n "$(ps -a -o comm | grep 'java')" ]]
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
}
rcon_client_exists() {
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
}
mc_server_listening() {

View File

@@ -3,12 +3,12 @@
[unpauseMCServer-server]
sequence = 25565
seq_timeout = 1
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
tcpflags = syn
[unpauseMCServer-rcon]
sequence = 25575
seq_timeout = 1
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
tcpflags = syn
[unpauseMCServer-bedrock]
sequence = 19132:udp

View File

@@ -2,7 +2,7 @@
. /start-utils
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world
rcon-cli save-all >/dev/null

View File

@@ -2,7 +2,7 @@
. /start-utils
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
logAutopauseAction "Knocked, resuming Java process"
pkill -CONT java
fi

View File

@@ -40,7 +40,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
else
exec ${SCRIPTS:-/}start-configuration $@
fi

View File

@@ -63,7 +63,7 @@ fi
if ! which java > /dev/null; then
log "Fixing PATH to include java"
PATH="${PATH}:/usr/bin"
PATH="${PATH}:/opt/java/openjdk/bin"
fi
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
@@ -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 "$@"
;;
@@ -122,7 +128,15 @@ case "${TYPE^^}" in
exec ${SCRIPTS:-/}start-deployFabric "$@"
;;
FTBA)
exec ${SCRIPTS:-/}start-deployFTBA "$@"
;;
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 "$@"
;;
@@ -167,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" "$@"
;;

View File

@@ -85,8 +85,6 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
exit 2
fi
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
log "Installing forge server"
dirOfInstaller=$(dirname "${forgeInstallerJar}")
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)

View File

@@ -47,7 +47,6 @@ if [ ! -d "$librariesDir" ]; then
exit 1
fi
mkdir "$librariesDir"
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
log "ERROR: failed to unzip Crucible libraries"
exit 1

View File

@@ -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}