mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-06-06 10:49:43 +00:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 966c74cd08 | |||
| d84b58dfd0 | |||
| 7aaf106ffe | |||
| 5f77902441 | |||
| c200efc9c9 | |||
| e924126a56 | |||
| bbd3d3cfc1 | |||
| d77c19c69b | |||
| 7ee77e4f47 | |||
| 84d0cff4c8 | |||
| 70519b9764 | |||
| 4683ea496d | |||
| 0e3a82f9d3 | |||
| d2554f2271 | |||
| 55e62371ac | |||
| c9a5fcfac8 | |||
| a1f8154d05 | |||
| e5d0a9362a | |||
| ca9c280b0b | |||
| 6ef4e984c7 | |||
| ea4f78346a | |||
| 007f9426bf |
@@ -0,0 +1,25 @@
|
|||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
minecraft_server:
|
||||||
|
docker:
|
||||||
|
- image: circleci/buildpack-deps:stable
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup_remote_docker
|
||||||
|
- run:
|
||||||
|
name: Build image
|
||||||
|
command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH} .
|
||||||
|
# - run:
|
||||||
|
# name: Build arm v7 image
|
||||||
|
# command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH}-arm-v7 --platform linux/arm/v7 --build-arg ARCH=armv7 .
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build:
|
||||||
|
jobs:
|
||||||
|
- minecraft_server:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- armv7
|
||||||
|
- multiarch
|
||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
|
Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps:
|
||||||
|
|
||||||
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
|
1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix
|
||||||
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetupWorld` at the end of the script
|
2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetup01World` at the end of the script
|
||||||
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
|
3. Develop and test the changes using the [iterative process described below](#iterative-script-development)
|
||||||
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration)
|
4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration)
|
||||||
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
|
5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail
|
||||||
@@ -70,5 +70,5 @@ The multiarch images are built and published by [a Github action](https://github
|
|||||||
The following git command can be used to provide the bulk of release notes content:
|
The following git command can be used to provide the bulk of release notes content:
|
||||||
|
|
||||||
```shell script
|
```shell script
|
||||||
git log --invert-grep --grep "^ci:" --grep "^misc:" --grep "^docs:" --pretty="- %s" 1.1.0..1.2.0
|
git log --invert-grep --grep "^ci:" --grep "^misc:" --pretty="- %s" 1.1.0..1.2.0
|
||||||
```
|
```
|
||||||
|
|||||||
+3
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM openjdk:8u212-jre-alpine
|
FROM adoptopenjdk/openjdk8-openj9:alpine
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
LABEL maintainer "itzg"
|
||||||
|
|
||||||
@@ -67,10 +67,11 @@ COPY log4j2.xml /tmp/log4j2.xml
|
|||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
|
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_" \
|
||||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 AUTOPAUSE_PERIOD=10
|
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 AUTOPAUSE_PERIOD=10
|
||||||
|
|
||||||
COPY start* /
|
COPY start* /
|
||||||
|
|||||||
@@ -176,8 +176,6 @@ You can also query the container's health in a script friendly way:
|
|||||||
healthy
|
healthy
|
||||||
```
|
```
|
||||||
|
|
||||||
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
|
||||||
|
|
||||||
## Autopause (experimental)
|
## Autopause (experimental)
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
@@ -308,7 +306,7 @@ defined environment variables. Variables that you want to replace need to be wra
|
|||||||
inside `${YOUR_VARIABLE}` curly brackets and prefixed with a dollar sign. This is the regular
|
inside `${YOUR_VARIABLE}` curly brackets and prefixed with a dollar sign. This is the regular
|
||||||
syntax for enviromment variables inside strings or config files.
|
syntax for enviromment variables inside strings or config files.
|
||||||
|
|
||||||
Optionally you can also define a prefix to only match predefined environment variables.
|
Optionally you can also define a prefix to only match predefined enviroment variables.
|
||||||
|
|
||||||
`ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix
|
`ENV_VARIABLE_PREFIX="CFG_"` <-- this is the default prefix
|
||||||
|
|
||||||
@@ -324,8 +322,6 @@ There are some limitations to what characters you can use.
|
|||||||
Variables will be replaced in files with the following extensions:
|
Variables will be replaced in files with the following extensions:
|
||||||
`.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`.
|
`.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`.
|
||||||
|
|
||||||
Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`. Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`.
|
|
||||||
|
|
||||||
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
|
||||||
@@ -400,7 +396,45 @@ If you are hosting your own copy of Bukkit/Spigot you can override the download
|
|||||||
|
|
||||||
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`
|
||||||
|
|
||||||
If you have attached a host directory to the `/data` volume, then you can install plugins within the `plugins` subdirectory. You can also [attach a `/plugins` volume](#deploying-plugins-from-attached-volume). If you add plugins while the container is running, you'll need to restart it to pick those up.
|
You can install Bukkit plugins in two ways...
|
||||||
|
|
||||||
|
### Using the /data volume
|
||||||
|
|
||||||
|
This is the easiest way if you are using a persistent `/data` mount.
|
||||||
|
|
||||||
|
To do this, you will need to attach the container's `/data` directory
|
||||||
|
(see "Attaching data directory to host filesystem”).
|
||||||
|
Then, you can add plugins to the `/path/on/host/plugins` folder you chose. From the example above,
|
||||||
|
the `/path/on/host` folder contents look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
/path/on/host
|
||||||
|
├── plugins
|
||||||
|
│ └── ... INSTALL PLUGINS HERE ...
|
||||||
|
├── ops.json
|
||||||
|
├── server.properties
|
||||||
|
├── whitelist.json
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If you add plugins while the container is running, you'll need to restart it to pick those
|
||||||
|
up:
|
||||||
|
|
||||||
|
docker stop mc
|
||||||
|
docker start mc
|
||||||
|
|
||||||
|
### Using separate mounts
|
||||||
|
|
||||||
|
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||||
|
or downloading a world with the `WORLD` option.
|
||||||
|
|
||||||
|
There is one additional volume that can be mounted; `/plugins`.
|
||||||
|
Any files in this filesystem will be copied over to the main
|
||||||
|
`/data/plugins` filesystem before starting Minecraft.
|
||||||
|
|
||||||
|
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
|
||||||
|
in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
## Running a PaperSpigot server
|
## Running a PaperSpigot server
|
||||||
|
|
||||||
@@ -417,10 +451,48 @@ If you are hosting your own copy of PaperSpigot you can override the download UR
|
|||||||
|
|
||||||
- -e PAPER_DOWNLOAD_URL=<url>
|
- -e PAPER_DOWNLOAD_URL=<url>
|
||||||
|
|
||||||
|
You can install Bukkit plugins in two ways...
|
||||||
|
|
||||||
An example compose file is provided at
|
An example compose file is provided at
|
||||||
[examples/docker-compose-paper.yml](examples/docker-compose-paper.yml).
|
[examples/docker-compose-paper.yml](examples/docker-compose-paper.yml).
|
||||||
|
|
||||||
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](#deploying-plugins-from-attached-volume). If you add plugins while the container is running, you'll need to restart it to pick those up.
|
### Using the /data volume
|
||||||
|
|
||||||
|
This is the easiest way if you are using a persistent `/data` mount.
|
||||||
|
|
||||||
|
To do this, you will need to attach the container's `/data` directory
|
||||||
|
(see "Attaching data directory to host filesystem”).
|
||||||
|
Then, you can add plugins to the `/path/on/host/plugins` folder you chose. From the example above,
|
||||||
|
the `/path/on/host` folder contents look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
/path/on/host
|
||||||
|
├── plugins
|
||||||
|
│ └── ... INSTALL PLUGINS HERE ...
|
||||||
|
├── ops.json
|
||||||
|
├── server.properties
|
||||||
|
├── whitelist.json
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If you add plugins while the container is running, you'll need to restart it to pick those
|
||||||
|
up:
|
||||||
|
|
||||||
|
docker stop mc
|
||||||
|
docker start mc
|
||||||
|
|
||||||
|
### Using separate mounts
|
||||||
|
|
||||||
|
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||||
|
or downloading a world with the `WORLD` option.
|
||||||
|
|
||||||
|
There is one additional volume that can be mounted; `/plugins`.
|
||||||
|
Any files in this filesystem will be copied over to the main
|
||||||
|
`/data/plugins` filesystem before starting Minecraft.
|
||||||
|
|
||||||
|
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
|
||||||
|
in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
## Running a Tuinity server
|
## Running a Tuinity server
|
||||||
|
|
||||||
@@ -598,12 +670,6 @@ This works well if you want to have a common set of modules 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.
|
||||||
|
|
||||||
## Deploying plugins from attached volume
|
|
||||||
|
|
||||||
There is one additional volume that can be mounted; `/plugins`. Any files in this filesystem will be copied over to the main `/data/plugins` filesystem before starting Minecraft. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
|
||||||
|
|
||||||
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 in either persistent volumes or a downloadable archive.
|
|
||||||
|
|
||||||
## Running with a custom server JAR
|
## Running with a custom server JAR
|
||||||
|
|
||||||
If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server
|
If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server
|
||||||
@@ -909,7 +975,7 @@ For example (just the `-e` bits):
|
|||||||
|
|
||||||
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
|
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
|
||||||
|
|
||||||
docker run -d -e 'RESOURCE_PACK=http\://link.com/to/pack.zip?\=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0'
|
docker run -d -e 'RESROUCE_PACK=http\://link.com/to/pack.zip?\=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0'
|
||||||
|
|
||||||
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
|
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
|
||||||
|
|
||||||
@@ -947,9 +1013,6 @@ read-only volume attachment to ensure the clone source remains pristine.
|
|||||||
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
||||||
```
|
```
|
||||||
|
|
||||||
### Overwrite world on start
|
|
||||||
The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start.
|
|
||||||
|
|
||||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||||
|
|
||||||
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||||
@@ -1046,6 +1109,14 @@ via a `JVM_XX_OPTS` environment variable.
|
|||||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||||
|
|
||||||
|
The container uses [OpenJ9](https://www.eclipse.org/openj9/docs) and a couple of J9 options are
|
||||||
|
simplified by environment variables:
|
||||||
|
|
||||||
|
- `-e TUNE_VIRTUALIZED=TRUE` : enables the option to
|
||||||
|
[optimize for virtualized environments](https://www.eclipse.org/openj9/docs/xtunevirtualized/)
|
||||||
|
- `-e TUNE_NURSERY_SIZES=TRUE` : configures nursery sizes where the initial size is 50%
|
||||||
|
of the `MAX_MEMORY` and the max size is 80%.
|
||||||
|
|
||||||
### Enable Remote JMX for Profiling
|
### Enable Remote JMX for Profiling
|
||||||
|
|
||||||
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as:
|
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as:
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
if isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||||
echo "Healthcheck disabled"
|
|
||||||
exit 0
|
|
||||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
|
||||||
echo "Java process suspended by Autopause function"
|
echo "Java process suspended by Autopause function"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -102,4 +102,4 @@ export TYPE=SPIGOT
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ fi
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
exec ${SCRIPTS:-/}start-finalSetup01World "$@"
|
||||||
|
|||||||
+1
-1
@@ -28,4 +28,4 @@ fi
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -135,4 +135,4 @@ elif [ -e "${FTB_DIR}/Install.sh" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -75,4 +75,4 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Contineut to Final Setup
|
# Contineut to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -113,4 +113,4 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -15,4 +15,4 @@ fi
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -40,4 +40,4 @@ fi
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
exec ${SCRIPTS:-/}start-finalSetup01World "$@"
|
||||||
|
|||||||
+1
-1
@@ -20,4 +20,4 @@ export TYPE=SPIGOT
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
@@ -36,4 +36,4 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -24,4 +24,4 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
+1
-1
@@ -43,4 +43,4 @@ fi
|
|||||||
isDebugging && ls -l
|
isDebugging && ls -l
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ else
|
|||||||
worldDest=/data/$LEVEL
|
worldDest=/data/$LEVEL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
||||||
if isURL $WORLD; then
|
if isURL $WORLD; then
|
||||||
curl -fsSL "$WORLD" -o /tmp/world.zip
|
curl -fsSL "$WORLD" -o /tmp/world.zip
|
||||||
zipSrc=/tmp/world.zip
|
zipSrc=/tmp/world.zip
|
||||||
@@ -37,10 +37,10 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
log "ERROR invalid world content"
|
log "ERROR invalid world content"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
|
mv "$baseDir" "$worldDest"
|
||||||
else
|
else
|
||||||
log "Cloning world directory from $WORLD ..."
|
log "Cloning world directory from $WORLD ..."
|
||||||
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
|
cp -r "$WORLD" "$worldDest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
@@ -51,4 +51,4 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupModpack $@
|
exec ${SCRIPTS:-/}start-finalSetup02Modpack $@
|
||||||
@@ -154,4 +154,4 @@ if [[ "${GENERIC_PACK}" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupModconfig $@
|
exec ${SCRIPTS:-/}start-finalSetup03Modconfig $@
|
||||||
@@ -24,4 +24,4 @@ case "X$MODCONFIG" in
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupPlugins $@
|
exec ${SCRIPTS:-/}start-finalSetup04ServerProperties $@
|
||||||
@@ -206,4 +206,4 @@ if isDebugging; then
|
|||||||
cat /data/server.properties
|
cat /data/server.properties
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
exec ${SCRIPTS:-/}start-finalSetup05EnvVariables $@
|
||||||
@@ -2,20 +2,8 @@
|
|||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
: ${ENV_VARIABLE_PREFIX:=CFG_}
|
if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then
|
||||||
|
|
||||||
if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
|
||||||
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
||||||
|
|
||||||
findExcludes=
|
|
||||||
for f in ${REPLACE_ENV_VARIABLES_EXCLUDES}; do
|
|
||||||
findExcludes="${findExcludes} -not -name $f"
|
|
||||||
done
|
|
||||||
for p in ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}; do
|
|
||||||
findExcludes="${findExcludes} -not -path \"*$p*\""
|
|
||||||
done
|
|
||||||
isDebugging && echo "Using find exclusion: $findExcludes"
|
|
||||||
|
|
||||||
while IFS='=' read -r name value ; do
|
while IFS='=' read -r name value ; do
|
||||||
# check if name of env variable matches the prefix
|
# check if name of env variable matches the prefix
|
||||||
# sanity check environment variables to avoid code injections
|
# sanity check environment variables to avoid code injections
|
||||||
@@ -32,7 +20,6 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
|||||||
find /data/ -type f \
|
find /data/ -type f \
|
||||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||||
-or -name "*.conf" -or -name "*.properties" \) \
|
-or -name "*.conf" -or -name "*.properties" \) \
|
||||||
$findExcludes \
|
|
||||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||||
fi
|
fi
|
||||||
done < <(env)
|
done < <(env)
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
|
||||||
|
|
||||||
: ${PLUGINS_SYNC_UPDATE:=true}
|
|
||||||
|
|
||||||
isDebugging && set -x
|
|
||||||
|
|
||||||
if [ -d /plugins ]; then
|
|
||||||
case ${TYPE} in
|
|
||||||
SPIGOT|BUKKIT|PAPER)
|
|
||||||
mkdir -p /data/plugins
|
|
||||||
log "Copying plugins over..."
|
|
||||||
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
|
||||||
updateArg="--update"
|
|
||||||
fi
|
|
||||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
|
||||||
@@ -66,6 +66,18 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
case ${TYPE} in
|
||||||
|
SPIGOT|BUKKIT|PAPER)
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
if [ -d /plugins ]; then
|
||||||
|
log "Copying plugins over..."
|
||||||
|
# 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
|
||||||
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
EXTRA_ARGS=""
|
EXTRA_ARGS=""
|
||||||
# Optional disable console
|
# Optional disable console
|
||||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||||
@@ -88,6 +100,23 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if isTrue ${TUNE_VIRTUALIZED}; then
|
||||||
|
JVM_XX_OPTS="${JVM_XX_OPTS} -Xtune:virtualized"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if isTrue ${TUNE_NURSERY_SIZES}; then
|
||||||
|
case ${MAX_MEMORY^^} in
|
||||||
|
*G)
|
||||||
|
MAX_MEMORY_MB=$(( ${MAX_MEMORY%?} * 1024 )) ;;
|
||||||
|
*M)
|
||||||
|
MAX_MEMORY_MB=${MAX_MEMORY%?} ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
NURSERY_MINIMUM=$(( ${MAX_MEMORY_MB} / 2 ))
|
||||||
|
NURSERY_MAXIMUM=$(( ${MAX_MEMORY_MB} * 4/5 ))
|
||||||
|
JVM_XX_OPTS="${JVM_XX_OPTS} -Xmns${NURSERY_MINIMUM}M -Xmnx${NURSERY_MAXIMUM}M"
|
||||||
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_JMX}; then
|
if isTrue ${ENABLE_JMX}; then
|
||||||
: ${JMX_HOST:=0.0.0.0}
|
: ${JMX_HOST:=0.0.0.0}
|
||||||
: ${JMX_PORT:=7091}
|
: ${JMX_PORT:=7091}
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ fi
|
|||||||
log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}"
|
log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}"
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
exec ${SCRIPTS:-/}start-finalSetup01World "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user