Auto-merging via docker-versions-create

This commit is contained in:
Geoff Bourne
2020-04-10 11:08:47 -05:00
10 changed files with 98 additions and 98 deletions
+34 -43
View File
@@ -1,4 +1,3 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/) [![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/)
[![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/) [![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/)
[![GitHub Issues](https://img.shields.io/github/issues-raw/itzg/docker-minecraft-server.svg)](https://github.com/itzg/docker-minecraft-server/issues) [![GitHub Issues](https://img.shields.io/github/issues-raw/itzg/docker-minecraft-server.svg)](https://github.com/itzg/docker-minecraft-server/issues)
@@ -7,7 +6,7 @@
This docker image provides a Minecraft Server that will automatically download the latest stable This docker image provides a Minecraft Server that will automatically download the latest stable
version at startup. You can also run/upgrade to any specific version or the version at startup. You can also run/upgrade to any specific version or the
latest snapshot. See the *Versions* section below for more information. latest snapshot. See the _Versions_ section below for more information.
[![Click for more docs](https://i.imgur.com/jS02ebD.png)](https://github.com/itzg/docker-minecraft-server/blob/master/README.md) [![Click for more docs](https://i.imgur.com/jS02ebD.png)](https://github.com/itzg/docker-minecraft-server/blob/master/README.md)
@@ -108,9 +107,9 @@ and start the server again with `docker start CONTAINERID` to pick up the new co
To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value
* LATEST (the default) - LATEST (the default)
* SNAPSHOT - SNAPSHOT
* or a specific version, such as "1.7.9" - or a specific version, such as "1.7.9"
For example, to use the latest snapshot: For example, to use the latest snapshot:
@@ -130,7 +129,7 @@ the server jar remain in the `/data` directory. It is safe to remove those._
To use a different version of Java, please use a docker tag to run your Minecraft server. To use a different version of Java, please use a docker tag to run your Minecraft server.
| Tag name | Description | Linux | | Tag name | Description | Linux |
|---------|-------------|-------| | -------------- | ------------------------------------------- | ------------ |
| latest | **Default**. Uses Java version 8 update 212 | Alpine Linux | | latest | **Default**. Uses Java version 8 update 212 | Alpine Linux |
| adopt13 | Uses Java version 13 latest update | Alpine Linux | | adopt13 | Uses Java version 13 latest update | Alpine Linux |
| adopt11 | Uses Java version 11 latest update | Alpine Linux | | adopt11 | Uses Java version 11 latest update | Alpine Linux |
@@ -283,7 +282,8 @@ Variables will be replaced in files with the following extensions:
Here is a full example where we want to replace values inside a `database.yml`. Here is a full example where we want to replace values inside a `database.yml`.
```yml ```yml
...
---
database: database:
host: ${CFG_DB_HOST} host: ${CFG_DB_HOST}
name: ${CFG_DB_NAME} name: ${CFG_DB_NAME}
@@ -293,7 +293,7 @@ database:
This is how your `docker-compose.yml` file could look like: This is how your `docker-compose.yml` file could look like:
```yml ```yml
version: '3' version: "3"
# Other docker-compose examples in /examples # Other docker-compose examples in /examples
services: services:
@@ -339,19 +339,19 @@ Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with: If you are hosting your own copy of Bukkit/Spigot you can override the download URLs with:
* -e BUKKIT_DOWNLOAD_URL=<url>
* -e SPIGOT_DOWNLOAD_URL=<url> - -e BUKKIT_DOWNLOAD_URL=<url>
- -e SPIGOT_DOWNLOAD_URL=<url>
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true` You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
__NOTE: to avoid pegging the CPU when running Spigot,__ you will need to **NOTE: to avoid pegging the CPU when running Spigot,** you will need to
pass `--noconsole` at the very end of the command line and not use `-it`. For example, pass `--noconsole` at the very end of the command line and not use `-it`. For example,
docker run -d -v /path/on/host:/data \ docker run -d -v /path/on/host:/data \
-e TYPE=SPIGOT -e VERSION=1.8 \ -e TYPE=SPIGOT -e VERSION=1.8 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
You can install Bukkit plugins in two ways... You can install Bukkit plugins in two ways...
### Using the /data volume ### Using the /data volume
@@ -392,15 +392,6 @@ This works well if you want to have a common set of plugins in a separate
location, but still have multiple worlds with different server requirements location, but still have multiple worlds with different server requirements
in either persistent volumes or a downloadable archive. in either persistent volumes or a downloadable archive.
### Building an image with plugins
You can also create your own Docker images by extending the `itzg/minecraft-server` image.
The image contains an `ONBUILD` trigger that will copy a `plugins.yml` file from you build directory and download any plugins specified in it.
You can read about the [`ToF-BuildTools` and how to use them here](https://git.faldoria.de/tof/server/build-tools).
You can also find [an example](examples/ToF-build/) with a custom image in the examples dir.
## Running a PaperSpigot server ## Running a PaperSpigot server
Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line. Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line.
@@ -409,7 +400,7 @@ Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to y
-e TYPE=PAPER -e VERSION=1.9.4 \ -e TYPE=PAPER -e VERSION=1.9.4 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
__NOTE: to avoid pegging the CPU when running PaperSpigot,__ you will need to **NOTE: to avoid pegging the CPU when running PaperSpigot,** you will need to
pass `--noconsole` at the very end of the command line and not use `-it`. For example, pass `--noconsole` at the very end of the command line and not use `-it`. For example,
docker run -d -v /path/on/host:/data \ docker run -d -v /path/on/host:/data \
@@ -417,7 +408,8 @@ pass `--noconsole` at the very end of the command line and not use `-it`. For ex
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
If you are hosting your own copy of PaperSpigot you can override the download URL with: If you are hosting your own copy of PaperSpigot you can override the download URL with:
* -e PAPER_DOWNLOAD_URL=<url>
- -e PAPER_DOWNLOAD_URL=<url>
You can install Bukkit plugins in two ways... You can install Bukkit plugins in two ways...
@@ -470,7 +462,7 @@ but note the following additional steps needed...
You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment
variable. An FTB/CurseForge server modpack is available together with its respective variable. An FTB/CurseForge server modpack is available together with its respective
client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can client modpack on https://www.feed-the-beast.com under "Additional Files." Similar you can
locate the modpacks for CurseForge at https://minecraft.curseforge.com/modpacks . locate the modpacks for CurseForge at https://www.curseforge.com/minecraft/modpacks .
Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line.
@@ -740,14 +732,12 @@ By default the query port will be `25565` (UDP) but can easily be changed with t
docker run -d -e ENABLE_QUERY=true docker run -d -e ENABLE_QUERY=true
### Max players ### Max players
By default max players is 20, you can increase this with the `MAX_PLAYERS` variable. By default max players is 20, you can increase this with the `MAX_PLAYERS` variable.
docker run -d -e MAX_PLAYERS=50 docker run -d -e MAX_PLAYERS=50
### Max world size ### Max world size
This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain. This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
@@ -776,8 +766,8 @@ Enables command blocks
Force players to join in the default game mode. Force players to join in the default game mode.
* false - Players will join in the gamemode they left in. - false - Players will join in the gamemode they left in.
* true - Players will always join in the default gamemode. - true - Players will always join in the default gamemode.
`docker run -d -e FORCE_GAMEMODE=false` `docker run -d -e FORCE_GAMEMODE=false`
@@ -785,8 +775,8 @@ Force players to join in the default game mode.
Defines whether structures (such as villages) will be generated. Defines whether structures (such as villages) will be generated.
* false - Structures will not be generated in new chunks. - false - Structures will not be generated in new chunks.
* true - Structures will be generated in new chunks. - true - Structures will be generated in new chunks.
`docker run -d -e GENERATE_STRUCTURES=true` `docker run -d -e GENERATE_STRUCTURES=true`
@@ -841,6 +831,7 @@ Sets the area that non-ops can not edit (0 to disable)
docker run -d -e SPAWN_PROTECTION=0 docker run -d -e SPAWN_PROTECTION=0
### View Distance ### View Distance
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
It determines the server-side viewing distance. It determines the server-side viewing distance.
@@ -859,10 +850,10 @@ change the mode using `MODE` where you can either provide the [standard
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
shortcut values: shortcut values:
* creative - creative
* survival - survival
* adventure - adventure
* spectator (only for Minecraft 1.8 or later) - spectator (only for Minecraft 1.8 or later)
For example: For example:
@@ -895,12 +886,12 @@ environment variable set to `false`, such as
By default, a standard world is generated with hills, valleys, water, etc. A different level type can By default, a standard world is generated with hills, valleys, water, etc. A different level type can
be configured by setting `LEVEL_TYPE` to an expected type, such as be configured by setting `LEVEL_TYPE` to an expected type, such as
* DEFAULT - DEFAULT
* FLAT - FLAT
* LARGEBIOMES - LARGEBIOMES
* AMPLIFIED - AMPLIFIED
* CUSTOMIZED - CUSTOMIZED
* BUFFET - BUFFET
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties). Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
@@ -1024,10 +1015,10 @@ is passed to `docker run`.
By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several
ways to adjust the memory settings: ways to adjust the memory settings:
* `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) - `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`)
memory settings of the JVM memory settings of the JVM
* `INIT_MEMORY`, independently sets the initial heap size - `INIT_MEMORY`, independently sets the initial heap size
* `MAX_MEMORY`, independently sets the max heap size - `MAX_MEMORY`, independently sets the max heap size
The values of all three are passed directly to the JVM and support format/units as The values of all three are passed directly to the JVM and support format/units as
`<size>[g|G|m|M|k|K]`. For example: `<size>[g|G|m|M|k|K]`. For example:
-3
View File
@@ -1,3 +0,0 @@
FROM itzg/minecraft-server
ENV TYPE=SPIGOT
-13
View File
@@ -1,13 +0,0 @@
plugins:
worldedit:
file: WorldEdit.jar
url: https://dev.bukkit.org/projects/worldedit/files/latest
FastAsyncWorldEdit:
file: FastAsyncWorldEdit.jar
url: https://empcraft.com/fawe/latest.php?bukkit
worldguard:
file: WorldGuard.jar
url: https://dev.bukkit.org/projects/worldguard/files/latest
citizens:
file: Citizens.jar
url: https://dev.bukkit.org/projects/citizens/files/latest
+5
View File
@@ -0,0 +1,5 @@
FROM itzg/minecraft-server
ENV TYPE=PAPER
COPY plugins/*.jar /plugins/
@@ -0,0 +1,11 @@
version: '3.7'
services:
mc:
build: .
environment:
EULA: "TRUE"
ports:
- 25565:25565
stdin_open: true
tty: true
@@ -0,0 +1 @@
*.jar
@@ -0,0 +1 @@
Download Bukkit/Spigot plugin jars, such as [WorldEdit](https://dev.bukkit.org/projects/worldedit/files) and place them here. At image build time the `COPY` step will place those jars in `/plugins`. At container startup, the contents of `/plugins` are sync'ed into `/data/plugins` for use with Bukkit/Spigot/Paper server types.
+3 -1
View File
@@ -76,7 +76,9 @@ fi
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer') # Allow up to 2 levels since some modpacks have a top-level directory named
# for the modpack
forgeJar=$(find ${FTB_BASE_DIR} -maxdepth 2 -name 'forge*.jar' -a -not -name 'forge*installer')
if [[ "$forgeJar" ]]; then if [[ "$forgeJar" ]]; then
export FTB_BASE_DIR=$(dirname "${forgeJar}") export FTB_BASE_DIR=$(dirname "${forgeJar}")
log "No entry script found, so building one for ${forgeJar}" log "No entry script found, so building one for ${forgeJar}"
+5 -4
View File
@@ -35,15 +35,16 @@ case "X$WORLD" in
fi fi
;; ;;
*) *)
if [[ -d $WORLD ]]; then if [[ -d "$WORLD" ]]; then
if [[ ! -d $worldDest ]]; then if [[ ! -d "$worldDest" ]]; then
log "Cloning world directory from $WORLD ..." log "Cloning world directory from $WORLD ..."
cp -r $WORLD $worldDest cp -r "$WORLD" "$worldDest"
else else
log "Skipping clone from $WORLD since $worldDest exists" log "Skipping clone from $WORLD since $worldDest exists"
fi fi
else else
log "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file" log "World cloning source '$WORLD' doesn't seem to exist"
exit 1
fi fi
;; ;;
esac esac
+7 -3
View File
@@ -27,6 +27,7 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
fi fi
fi fi
if [ ${TYPE} != "SPIGOT" ]; then
# Set up log configuration # Set up log configuration
LOGFILE="/data/log4j2.xml" LOGFILE="/data/log4j2.xml"
if [ ! -e "$LOGFILE" ]; then if [ ! -e "$LOGFILE" ]; then
@@ -36,6 +37,7 @@ else
log "log4j2.xml already created, skipping" log "log4j2.xml already created, skipping"
fi fi
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}" JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
fi
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades) # Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
log "Checking for JSON files." log "Checking for JSON files."
@@ -64,15 +66,17 @@ do
fi fi
done done
case ${TYPE} in
SPIGOT|BUKKIT|PAPER)
mkdir -p /data/plugins mkdir -p /data/plugins
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then if [ -d /plugins ]; then
log "Copying any Bukkit plugins over..." log "Copying plugins over..."
# Copy plugins over using rsync to allow deeply nested updates of plugins # Copy plugins over using rsync to allow deeply nested updates of plugins
# only updates files if the source file is newer and print updated files # only updates files if the source file is newer and print updated files
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
fi fi
fi ;;
esac
EXTRA_ARGS="" EXTRA_ARGS=""
# Optional disable console # Optional disable console