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

115
README.md
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:
@@ -129,14 +128,14 @@ 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 |
| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux | | openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux |
| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux | | openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux |
| multiarch | Uses Java version 8 latest update | Debian Linux | | multiarch | Uses Java version 8 latest update | Debian Linux |
For example, to use a Java version 13: For example, to use a Java version 13:
@@ -283,17 +282,18 @@ 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}
password: ${CFG_DB_PASSWORD} password: ${CFG_DB_PASSWORD}
``` ```
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.
@@ -665,7 +657,7 @@ and in the same directory as that file run
docker-compose up -d docker-compose up -d
Now, go play...or adjust the `environment` section to configure Now, go play...or adjust the `environment` section to configure
this server instance. this server instance.
## Server configuration ## Server configuration
@@ -709,7 +701,7 @@ values.
To whitelist players for your Minecraft server, pass the Minecraft usernames separated by commas via the `WHITELIST` environment variable, such as To whitelist players for your Minecraft server, pass the Minecraft usernames separated by commas via the `WHITELIST` environment variable, such as
docker run -d -e WHITELIST=user1,user2 ... docker run -d -e WHITELIST=user1,user2 ...
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible. If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
@@ -717,7 +709,7 @@ If the `WHITELIST` environment variable is not used, any user can join your Mine
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
docker run -d -e OPS=user1,user2 ... docker run -d -e OPS=user1,user2 ...
### Server icon ### Server icon
@@ -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.
@@ -766,7 +756,7 @@ Allows server to announce when a player gets an achievement.
docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true
### Enable Command Block ### Enable Command Block
Enables command blocks Enables command blocks
@@ -776,19 +766,19 @@ 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`
### Generate Structures ### Generate Structures
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`
### Hardcore ### Hardcore
@@ -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).
@@ -933,10 +924,10 @@ where the default is "world":
### Downloadable world ### Downloadable world
Instead of mounting the `/data` volume, you can instead specify the URL of Instead of mounting the `/data` volume, you can instead specify the URL of
a ZIP file containing an archived world. This will be downloaded, and a ZIP file containing an archived world. This will be downloaded, and
unpacked in the `/data` directory; if it does not contain a subdirectory unpacked in the `/data` directory; if it does not contain a subdirectory
called `world/` then it will be searched for a file `level.dat` and the called `world/` then it will be searched for a file `level.dat` and the
containing subdirectory renamed to `world`. This means that most of the containing subdirectory renamed to `world`. This means that most of the
archived Minecraft worlds downloadable from the Internet will already be in archived Minecraft worlds downloadable from the Internet will already be in
the correct format. the correct format.
@@ -948,7 +939,7 @@ directory, if required.
**NOTE:** Unless you also mount `/data` as an external volume, this world **NOTE:** Unless you also mount `/data` as an external volume, this world
will be deleted when the container is deleted. will be deleted when the container is deleted.
**NOTE:** This URL must be accessible from inside the container. Therefore, **NOTE:** This URL must be accessible from inside the container. Therefore,
you should use an IP address or a globally resolveable FQDN, or else the you should use an IP address or a globally resolveable FQDN, or else the
name of a linked container. name of a linked container.
@@ -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:

View File

@@ -1,3 +0,0 @@
FROM itzg/minecraft-server
ENV TYPE=SPIGOT

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

View File

@@ -0,0 +1,5 @@
FROM itzg/minecraft-server
ENV TYPE=PAPER
COPY plugins/*.jar /plugins/

View File

@@ -0,0 +1,11 @@
version: '3.7'
services:
mc:
build: .
environment:
EULA: "TRUE"
ports:
- 25565:25565
stdin_open: true
tty: true

View File

@@ -0,0 +1 @@
*.jar

View File

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

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

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

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
mkdir -p /data/plugins case ${TYPE} in
if [ "$TYPE" = "SPIGOT" ]; then SPIGOT|BUKKIT|PAPER)
if [ -d /plugins ]; then mkdir -p /data/plugins
log "Copying any Bukkit plugins over..." if [ -d /plugins ]; then
# Copy plugins over using rsync to allow deeply nested updates of plugins log "Copying plugins over..."
# only updates files if the source file is newer and print updated files # Copy plugins over using rsync to allow deeply nested updates of plugins
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data # only updates files if the source file is newer and print updated files
fi rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
fi fi
;;
esac
EXTRA_ARGS="" EXTRA_ARGS=""
# Optional disable console # Optional disable console