Skip to content

Commit

Permalink
Add NoScreen environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberops7 committed Dec 17, 2023
1 parent 41cc824 commit d91ae83
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ A popular place to get plugins is: <a href="https://dev.bukkit.org/bukkit-plugin
<ul>
<li>August 22nd 2022</li>
<ul>
<li>Attempt to fix screen on Azure instances</li>
<li>Add NoScreen environment variable -- thjs disables screen which prevents needing an interactive terminal (but disables some logging)</li>
</ul>
<li>August 18th 2022</li>
<ul>
Expand Down
3 changes: 3 additions & 0 deletions amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ENV MaxMemory=
# Optional Paper Minecraft Version override
ENV Version="1.19.2"

# Optional switch to prevent usage of screen (disables logging but may fix container launch issues on some platforms)
ENV NoScreen=

# IPV4 Ports
EXPOSE 25565/tcp
EXPOSE 19132/tcp
Expand Down
3 changes: 3 additions & 0 deletions arm64v8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ ENV MaxMemory=
# Optional Paper Minecraft Version override
ENV Version="1.19.2"

# Optional switch to prevent usage of screen (disables logging but may fix container launch issues on some platforms)
ENV NoScreen=

# IPV4 Ports
EXPOSE 25565/tcp
EXPOSE 19132/tcp
Expand Down
3 changes: 3 additions & 0 deletions armv7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ ENV MaxMemory=
# Optional Paper Minecraft Version override
ENV Version="1.19.2"

# Optional switch to prevent usage of screen (disables logging but may fix container launch issues on some platforms)
ENV NoScreen=

# IPV4 Ports
EXPOSE 25565/tcp
EXPOSE 19132/tcp
Expand Down
3 changes: 3 additions & 0 deletions ppc64le.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ ENV MaxMemory=
# Optional Paper Minecraft Version override
ENV Version="1.19.2"

# Optional switch to prevent usage of screen (disables logging but may fix container launch issues on some platforms)
ENV NoScreen=

# IPV4 Ports
EXPOSE 25565/tcp
EXPOSE 19132/tcp
Expand Down
3 changes: 3 additions & 0 deletions s390x.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ ENV MaxMemory=
# Optional Paper Minecraft Version override
ENV Version="1.19.2"

# Optional switch to prevent usage of screen (disables logging but may fix container launch issues on some platforms)
ENV NoScreen=

# IPV4 Ports
EXPOSE 25565/tcp
EXPOSE 19132/tcp
Expand Down
13 changes: 10 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,16 @@ fi
# Start server
echo "Starting Minecraft server..."

script /dev/null
if [[ -z "$MaxMemory" ]] || [[ "$MaxMemory" -le 0 ]]; then
screen -L -Logfile /minecraft/logs/minecraft.$(date +%Y.%m.%d.%H.%M.%S).log -mS minecraft /jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -jar /minecraft/paperclip.jar
if [ -z "$NoScreen" ]; then
screen -L -Logfile /minecraft/logs/minecraft.$(date +%Y.%m.%d.%H.%M.%S).log -mS minecraft /jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -jar /minecraft/paperclip.jar
else
/jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -jar /minecraft/paperclip.jar
fi
else
screen -L -Logfile /minecraft/logs/minecraft.$(date +%Y.%m.%d.%H.%M.%S).log -mS minecraft /jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -Xmx${MaxMemory}M -jar /minecraft/paperclip.jar
if [ -z "$NoScreen" ]; then
screen -L -Logfile /minecraft/logs/minecraft.$(date +%Y.%m.%d.%H.%M.%S).log -mS minecraft /jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -Xmx${MaxMemory}M -jar /minecraft/paperclip.jar
else
/jre/bin/java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -Xmx${MaxMemory}M -jar /minecraft/paperclip.jar
fi
fi

0 comments on commit d91ae83

Please sign in to comment.