3 Commits

Author SHA1 Message Date
ed6fc1af16 Add trap to gracefully cleanup, add screen session 2021-05-12 22:41:01 -05:00
df3c6166ac Bump Forge to 1.16.5-36.1.13 2021-05-11 21:02:24 -05:00
7bd0953dad Update README 2021-04-09 16:56:32 -05:00
3 changed files with 13 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ FROM alpine:latest AS build
# Args
ARG MINECRAFT_VERSION="1.16.5"
ARG FORGE_VERSION="36.1.4"
ARG FORGE_VERSION="36.1.13"
# The actual setup work
COPY start-server.sh /minecraft/start-server.sh
@@ -17,7 +17,7 @@ RUN apk add curl openjdk8-jre &&\
# The second stage is the actual container
FROM openjdk:8
RUN apt-get update && apt-get install rsync -y
RUN apt-get update && apt-get install rsync screen -y
WORKDIR /minecraft
COPY --from=build /minecraft .
CMD [ "bash", "start-server.sh" ]

View File

@@ -7,10 +7,12 @@ A Dockerfile and some assorted scripts to build a Minecraft Forge server contain
Deploy as expected:
```bash
docker run -p 25565:25565 rehashedsalt/minecraft-forge
docker run -p 25565:25565 rehashedsalt/minecraft-forge:1.16.5-36.1.4-1.0.0
```
And badda bing, badda boom, you'll have a Minecraft Forge server of whatever the latest stable is.
And badda bing, badda boom, you'll have a Minecraft Forge server of whatever the tag is.
For obvious reason, you **should never use the :latest tag!**
## Application State

View File

@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash
#
# start-server.sh
# Copyright (C) 2021 Vintage Salt <rehashedsalt@cock.li>
@@ -33,5 +33,10 @@ java -version
echo "Invoking java with args: $args"
# Start 'er up
java $args
cleanup() {
screen -p 0 -S minecraft -X stuff save-all^M
screen -p 0 -S minecraft -X stuff stop^M
}
trap cleanup EXIT
screen -DmS minecraft java $args