Skip to content

Commit dac3882

Browse files
authored
Support multiple values for COPY_PLUGINS_SRC, COPY_MODS_SRC, and COPY_CONFIG_SRC (#3377)
1 parent 231ac0f commit dac3882

File tree

10 files changed

+34
-14
lines changed

10 files changed

+34
-14
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
5050
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
5151
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
5252

53-
ARG MC_HELPER_VERSION=1.41.2
53+
ARG MC_HELPER_VERSION=1.41.5
5454
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
5555
# used for cache busting local copy of mc-image-helper
5656
ARG MC_HELPER_REV=1

docs/mods-and-plugins/index.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ On the left, there are sections describing some download automation options.
1616

1717
## Mods vs Plugins
1818

19-
The terms "mods" and "plugins" can be quite confusing. Generally, the rule of thumb is that "mods" are used by the types that run client side to modify rendering, add new blocks, and add behaviors server, such as [Forge](../types-and-platforms/server-types/forge.md) and [Fabric](../types-and-platforms/server-types/fabric.md). "Plugins" are used by the types that **only run on servers** to add behaviors, commands, etc such as [Paper](../types-and-platforms/server-types/paper.md) (which derives from [Bukkit/Spigot](../types-and-platforms/server-types/bukkit-spigot.md)). There are also some types that are [hybrids](../types-and-platforms/server-types/hybrids.md), such as Magma, that use both "mods" and "plugins"
19+
The terms "mods" and "plugins" can be quite confusing. Generally, the rule of thumb is that "mods" are used by the types that run client side to modify rendering, add new blocks, and add behaviors server, such as [Forge](../types-and-platforms/server-types/forge.md) and [Fabric](../types-and-platforms/server-types/fabric.md). "Plugins" are used by the types that **only run on servers** to add behaviors, commands, etc such as [Paper](../types-and-platforms/server-types/paper.md) (which derives from [Bukkit/Spigot](../types-and-platforms/server-types/bukkit-spigot.md)). There are also some types that are [hybrids](../types-and-platforms/server-types/hybrids.md), such as Magma, that use both "mods" and "plugins".
20+
21+
Typically, mods needs to be installed in both the client and server; however, there are some cases when only the server needs a mod. Plugins only need to be installed in the server and are never needed in the client.
2022

2123
## Optional plugins, mods, and config attach points
2224

@@ -41,8 +43,28 @@ For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMO
4143

4244
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.
4345

44-
!!! information ""
45-
For more flexibility with mods/plugins preparation, you can declare other directories, files, and URLs to use in [the `MODS` / `PLUGINS` variables](#modsplugins-list).
46+
!!! information "Multiple source directories"
47+
48+
`COPY_PLUGINS_SRC`, `COPY_MODS_SRC`, `COPY_CONFIG_SRC` can each be set to a comma or newline delimited list of container directories to reference.
49+
50+
For example, in a compose file:
51+
52+
```yaml
53+
environment:
54+
# ...EULA, etc
55+
TYPE: PAPER
56+
# matches up to volumes declared below
57+
COPY_PLUGINS_SRC: /plugins-common,/plugins-local
58+
volumes:
59+
- mc-data:/data
60+
# For example, reference a shared directory used by several projects
61+
- ../plugins-common:/plugins-common:ro
62+
# and add plugins unique to this project
63+
- ./plugins:/plugins-local:ro
64+
```
65+
66+
Alternatively, you can declare other directories along with files and URLs to use in [the `MODS` / `PLUGINS` variables](#modsplugins-list).
67+
4668

4769

4870
## Zip file modpack
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
services:
22
mc:
33
image: itzg/minecraft-server
4-
container_name: paper
4+
tty: true
5+
stdin_open: true
56
environment:
67
EULA: "true"
78
TYPE: PAPER
8-
VIEW_DISTANCE: 10
99
MEMORY: 2G
1010
ports:
1111
- "25565:25565"
1212
volumes:
13-
- mc-paper:/data
13+
- mc-data:/data
1414
restart: unless-stopped
1515
volumes:
16-
mc-paper: {}
16+
mc-data: {}

scripts/start-setupMounts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function mc-image-helper-mounts(){
3838
: "${COPY_PLUGINS_SRC:="/plugins"}"
3939
: "${COPY_PLUGINS_DEST:=${PLUGINS_OUT_DIR}}"
4040

41-
if usesPlugins && [ -d "${COPY_PLUGINS_SRC}" ]; then
41+
if usesPlugins; then
4242
mkdir -p "${COPY_PLUGINS_DEST}"
4343
log "Copying any plugins from ${COPY_PLUGINS_SRC} to ${COPY_PLUGINS_DEST}"
4444
mc-image-helper-mounts "${COPY_PLUGINS_SRC}" "${COPY_PLUGINS_DEST}"
@@ -47,17 +47,15 @@ fi
4747
: "${COPY_MODS_SRC:="/mods"}"
4848
: "${COPY_MODS_DEST:=${MODS_OUT_DIR}}"
4949

50-
if usesMods && [ -d "${COPY_MODS_SRC}" ]; then
50+
if usesMods; then
5151
log "Copying any mods from ${COPY_MODS_SRC} to ${COPY_MODS_DEST}"
5252
mc-image-helper-mounts "${COPY_MODS_SRC}" "${COPY_MODS_DEST}"
5353
fi
5454

5555
: "${COPY_CONFIG_SRC:="/config"}"
5656
: "${COPY_CONFIG_DEST:="/data/config"}"
5757

58-
if [ -d "${COPY_CONFIG_SRC}" ]; then
59-
log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}"
60-
mc-image-helper-mounts "${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}"
61-
fi
58+
log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}"
59+
mc-image-helper-mounts "${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}"
6260

6361
exec "${SCRIPTS:-/}start-setupServerProperties" "$@"

0 commit comments

Comments
 (0)