mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 07:26:24 +00:00
Compare commits
7 Commits
2021.9.0-j
...
2021.10.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b389561091 | ||
|
|
75f5a430e4 | ||
|
|
e0c721585e | ||
|
|
da21c2e0a7 | ||
|
|
2b989e4c39 | ||
|
|
6ee055761d | ||
|
|
7d6c80b941 |
28
README.md
28
README.md
@@ -262,7 +262,7 @@ If you want old mods to be removed as the `/mods` content is updated, then add `
|
|||||||
|
|
||||||
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
|
For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.
|
||||||
|
|
||||||
You can specify the destination of the files that are copied from `/config` by setting the `COPY_CONFIG_DEST` variable, where the default is `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
You can specify the destination of the files that are copied from `/mods` and `/config` by setting the `COPY_MODS_DEST` and `COPY_CONFIG_DEST`, where the default is `/data/mods` and `/data/config`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory.
|
||||||
|
|
||||||
> NOTE: If a file was updated in the destination path and is newer than the source file from `/config`, then it will not be overwritten.
|
> NOTE: If a file was updated in the destination path and is newer than the source file from `/config`, then it will not be overwritten.
|
||||||
|
|
||||||
@@ -512,9 +512,9 @@ the `/path/on/host` folder contents look like:
|
|||||||
```
|
```
|
||||||
/path/on/host
|
/path/on/host
|
||||||
├── mods
|
├── mods
|
||||||
│ └── ... INSTALL MODS HERE ...
|
│ └── ... INSTALL MODS HERE ...
|
||||||
├── config
|
├── config
|
||||||
│ └── ... CONFIGURE MODS HERE ...
|
│ └── ... CONFIGURE MODS HERE ...
|
||||||
├── ops.json
|
├── ops.json
|
||||||
├── server.properties
|
├── server.properties
|
||||||
├── whitelist.json
|
├── whitelist.json
|
||||||
@@ -527,24 +527,20 @@ up:
|
|||||||
docker stop mc
|
docker stop mc
|
||||||
docker start mc
|
docker start mc
|
||||||
|
|
||||||
### Using separate mounts
|
## Optional plugins, mods, and config attach points
|
||||||
|
|
||||||
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
There are optional volume paths that can be attached to supply content to be copied into the data area:
|
||||||
or downloading a world with the `WORLD` option.
|
|
||||||
|
|
||||||
There are two additional volumes that can be mounted; `/mods` and `/config`.
|
`/plugins`
|
||||||
Any files in either of these filesystems will be copied over to the main
|
: contents are copied into `/data/plugins` for Bukkit related server types. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||||
`/data` filesystem before starting Minecraft.
|
|
||||||
|
|
||||||
This works well if you want to have a common set of modules in a separate
|
`/mods`
|
||||||
location, but still have multiple worlds with different server requirements
|
: contents are copied into `/data/mods` for Forge related server types
|
||||||
in either persistent volumes or a downloadable archive.
|
|
||||||
|
|
||||||
## Deploying plugins from attached volume
|
`/config`
|
||||||
|
: contents are copied into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`
|
||||||
|
|
||||||
If the `/plugins` directory exists in the container, such as from an attached volume, any files in this directory will be copied over to `/data/plugins` before starting Minecraft. Set `PLUGINS_SYNC_UPDATE=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
These paths work well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Auto-downloading SpigotMC/Bukkit/PaperMC plugins
|
## Auto-downloading SpigotMC/Bukkit/PaperMC plugins
|
||||||
|
|
||||||
|
|||||||
@@ -33,5 +33,4 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
|
|||||||
@@ -167,6 +167,16 @@ if [[ $startScriptCount = 0 ]]; then
|
|||||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
|
|
||||||
|
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
||||||
|
if [[ "$installScript" ]]; then
|
||||||
|
(
|
||||||
|
cd "$(dirname "${installScript}")"
|
||||||
|
chmod +x ./install.sh
|
||||||
|
log "Running included install.sh"
|
||||||
|
./install.sh
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||||
|
|||||||
@@ -34,5 +34,4 @@ fi
|
|||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
|
|||||||
@@ -23,5 +23,4 @@ fi
|
|||||||
# Normalize on Spigot for later operations
|
# Normalize on Spigot for later operations
|
||||||
export TYPE=SPIGOT
|
export TYPE=SPIGOT
|
||||||
|
|
||||||
# Continue to Final Setup
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
|||||||
$dirExcludes \
|
$dirExcludes \
|
||||||
-type f \
|
-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" -or -name "*.hjson" -or -name "*.json" \) \
|
||||||
$fileExcludes \
|
$fileExcludes \
|
||||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,10 +21,12 @@ if [ -d /plugins ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
|
: ${COPY_MODS_DEST:="/data/mods"}
|
||||||
|
|
||||||
if [ -d /mods ]; then
|
if [ -d /mods ]; then
|
||||||
log "Copying any mods over..."
|
log "Copying any mods over..."
|
||||||
mkdir -p /data/mods
|
mkdir -p $COPY_MODS_DEST
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ $COPY_MODS_DEST
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||||
|
|||||||
Reference in New Issue
Block a user