mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e43669d792 | ||
|
|
cf4fed616a | ||
|
|
6d5b7b4362 | ||
|
|
9b538267a1 | ||
|
|
b7e93e56e5 | ||
|
|
3624dc02a3 | ||
|
|
705e266f76 | ||
|
|
a18a274c6c | ||
|
|
19c39f8e53 | ||
|
|
b40bd508f8 | ||
|
|
9dbc210caf | ||
|
|
2cdb7b2da7 | ||
|
|
4df1db9535 | ||
|
|
812b64045d | ||
|
|
f65d51fff8 | ||
|
|
fd2dfe3f0e | ||
|
|
d9b738f670 | ||
|
|
b8a7bf5a1d | ||
|
|
822bf929c9 | ||
|
|
b400dfbb74 | ||
|
|
1c670815d2 | ||
|
|
184d5b50d2 | ||
|
|
5624faebe7 | ||
|
|
104eac4e14 | ||
|
|
e0069692e0 | ||
|
|
03aaf45879 | ||
|
|
08b5303bd8 | ||
|
|
8efb486c56 | ||
|
|
2701fe5add | ||
|
|
906e6787ae | ||
|
|
a08bf868c8 | ||
|
|
b90f980d3b | ||
|
|
1e0d12869f | ||
|
|
1c73b818fd | ||
|
|
5bc6b4e12b | ||
|
|
7b1bd0bdb2 | ||
|
|
a701723cc1 | ||
|
|
2cde42b96e | ||
|
|
81571483e7 | ||
|
|
3f23c67098 | ||
|
|
b23593aec6 | ||
|
|
14cf300e82 | ||
|
|
f8ea9d49f5 | ||
|
|
c0be7dbb95 | ||
|
|
8017379723 | ||
|
|
df0c57d111 | ||
|
|
8d3ec29a44 | ||
|
|
c15b13d07d | ||
|
|
48367b7c1f | ||
|
|
dd6cda1ae5 | ||
|
|
877486802c | ||
|
|
7be36cc2cf |
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -10,9 +10,9 @@ body:
|
||||
Thanks for taking the time to report a bug.
|
||||
|
||||
Please double check some things first:
|
||||
- Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
|
||||
- Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
|
||||
- Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
|
||||
1. Do you just have a question about something? If so, asking in the [Q&A Discussions](https://github.com/itzg/docker-minecraft-server/discussions/categories/q-a) or asking on [the Discord server](https://discord.gg/DXfKpjB) would be best.
|
||||
2. Is this bug happening after the `[init]` prefixed logs and after the log that says "Starting the Minecraft server"? If so, please report the bug with Mojang or the respective server provider.
|
||||
3. Are you seeing a performance problem? If so, that is typically outside the scope of the image setup mechanims. Ask a question as above or contact the respective server provider.
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
|
||||
16
.github/workflows/build-multiarch.yml
vendored
16
.github/workflows/build-multiarch.yml
vendored
@@ -16,7 +16,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
|
||||
variant:
|
||||
- java19
|
||||
- java17
|
||||
- java17-graalvm-ce
|
||||
- java17-jdk
|
||||
@@ -31,6 +33,11 @@ jobs:
|
||||
- java11-openj9
|
||||
- java11-jdk
|
||||
include:
|
||||
# JAVA 19:
|
||||
- variant: java19
|
||||
baseImage: eclipse-temurin:19-jre-jammy
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
mcVersion: 1.19.3
|
||||
# JAVA 17:
|
||||
- variant: java17
|
||||
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
|
||||
@@ -110,6 +117,8 @@ jobs:
|
||||
type=ref,event=tag,enable=${{ matrix.variant == 'java17' }}
|
||||
type=ref,event=tag,suffix=-${{ matrix.variant }}
|
||||
type=raw,value=${{ matrix.variant }}
|
||||
# NOTE this identifies which variant will be published as "latest", which isn't
|
||||
# necessarily the newest version of Java
|
||||
flavor: |
|
||||
latest=${{ matrix.variant == 'java17' }}
|
||||
labels: |
|
||||
@@ -122,7 +131,7 @@ jobs:
|
||||
uses: docker/setup-qemu-action@v2.1.0
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v3.2.0
|
||||
uses: docker/build-push-action@v3.3.0
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
@@ -152,7 +161,7 @@ jobs:
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3.2.0
|
||||
uses: docker/build-push-action@v3.3.0
|
||||
if: github.actor == github.repository_owner
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
@@ -169,6 +178,9 @@ jobs:
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
# Since some consumers, like Watchtower are broken https://github.com/containrrr/watchtower/discussions/1529
|
||||
# Also refer to https://github.com/docker/build-push-action/releases/tag/v3.3.0
|
||||
provenance: false
|
||||
build-args: |
|
||||
BASE_IMAGE=${{ matrix.baseImage }}
|
||||
BUILD_FILES_REV=${{ steps.build-files-rev.outputs.REV }}
|
||||
|
||||
2
.github/workflows/verify-pr.yml
vendored
2
.github/workflows/verify-pr.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v3.2.0
|
||||
uses: docker/build-push-action@v3.3.0
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -14,7 +14,7 @@ RUN --mount=target=/build,source=build \
|
||||
|
||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||
|
||||
EXPOSE 25565 25575
|
||||
EXPOSE 25565
|
||||
|
||||
# hook into docker BuildKit --platform support
|
||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
@@ -31,7 +31,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.6.0 --var app=rcon-cli --file {{.app}} \
|
||||
--var version=1.6.1 --var app=rcon-cli --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
@@ -39,14 +39,14 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.8.2 --var app=mc-server-runner --file {{.app}} \
|
||||
--var version=1.8.3 --var app=mc-server-runner --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_HELPER_VERSION=1.22.12
|
||||
ARG MC_HELPER_VERSION=1.25.11
|
||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||
| tar -C /usr/share -zxf - \
|
||||
@@ -64,6 +64,8 @@ COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
COPY --chmod=755 bin/mc-health /health.sh
|
||||
COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
|
||||
# By default this file gets retrieved from repo, but bundle in image as potential fallback
|
||||
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
|
||||
COPY --chmod=755 files/auto /auto
|
||||
|
||||
RUN dos2unix /start* /auto/*
|
||||
|
||||
96
README.md
96
README.md
@@ -5,6 +5,8 @@
|
||||
[](https://github.com/itzg/docker-minecraft-server/actions)
|
||||
[](https://www.buymeacoffee.com/itzg)
|
||||
|
||||
## Intro
|
||||
|
||||
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
|
||||
latest snapshot. See the _Versions_ section below for more information.
|
||||
@@ -19,12 +21,10 @@ where, in this case, the standard server port 25565, will be exposed on your hos
|
||||
|
||||
> Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
|
||||
|
||||
> **DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
|
||||
|
||||
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](#versions) and the [`TYPE`](#server-types) can be configured to create many variations of desired Minecraft server.
|
||||
|
||||
## Mitigated Log4jShell Vulnerability
|
||||
|
||||
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.
|
||||
|
||||
## Looking for a Bedrock Dedicated Server
|
||||
|
||||
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
||||
@@ -195,6 +195,7 @@ When using the image `itzg/minecraft-server` without a tag, the `latest` image t
|
||||
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
|
||||
| java17-graalvm-ce | 17 | Oracle | GraalVM CE | amd64,arm64 |
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
|
||||
| java19 | 19 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||
|
||||
For example, to use Java version 8 on any supported architecture:
|
||||
|
||||
@@ -610,6 +611,79 @@ docker run -d --name mc-ftb -e EULA=TRUE \
|
||||
|
||||
## Running a server with a CurseForge modpack
|
||||
|
||||
### Auto CurseForge Management
|
||||
|
||||
To manage a CurseForge modpack automatically with upgrade support, pinned or latest version tracking, set `TYPE` to "AUTO_CURSEFORGE". The appropriate mod loader (Forge / Fabric) version will be automatically installed as declared by the modpack. This mode will also take care of cleaning up unused files installed by previous versions of the modpack, but world data is never auto-removed.
|
||||
|
||||
> **NOTES:**
|
||||
> Be sure to use the appropriate [image tag for the Java version compatible with the modpack](#running-minecraft-server-on-different-java-version).
|
||||
>
|
||||
> Most modpacks require a good amount of memory, so it best to set `MEMORY` to at least "4G" since the default is only 1 GB.
|
||||
|
||||
Use one of the following to specify the modpack to install:
|
||||
|
||||
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". For example:
|
||||
|
||||
```
|
||||
-e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||
```
|
||||
|
||||
Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as
|
||||
|
||||

|
||||
|
||||
For example:
|
||||
```
|
||||
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
|
||||
```
|
||||
|
||||
The latest file will be located and used by default, but if a specific version is desired you can use one of the following options. With any of these options **do not select a server file** -- they lack the required manifest and defeat the ability to consistently automate startup.
|
||||
|
||||
- Use `CF_PAGE_URL`, but include the full URL to a specific file
|
||||
- Set `CF_FILE_ID` to the numerical file ID
|
||||
- Specify a substring to match the desired filename with `CF_FILENAME_MATCHER`
|
||||
|
||||
The following shows where to get the URL to the specific file and also shows where the file ID is located:
|
||||
|
||||

|
||||
|
||||
The following examples all refer to version 1.0.7 of ATM8:
|
||||
|
||||
```
|
||||
-e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390
|
||||
```
|
||||
|
||||
```
|
||||
-e CF_SLUG=all-the-mods-8 -e CF_FILE_ID=4248390
|
||||
```
|
||||
|
||||
```
|
||||
-e CF_SLUG=all-the-mods-8 -e CF_FILENAME_MATCHER=1.0.7
|
||||
```
|
||||
|
||||
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods:
|
||||
|
||||
Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
|
||||
|
||||
Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. If either of these are set, then `CF_EXCLUDE_INCLUDE_FILE` will be **disabled**.
|
||||
|
||||
A mod's project ID can be obtained from the right hand side of the project page:
|
||||

|
||||
|
||||
If needing to iterate on the options above, set `CF_FORCE_SYNCHRONIZE` to "true" to ensure the exclude/includes are re-evaluated.
|
||||
|
||||
> **NOTE:** these options are provided to empower you to get your server up and running quickly. Please help out by reporting an issue with the respective mod project. Ideally mod developers should [use correct registrations for one-sided client mods](https://docs.minecraftforge.net/en/latest/concepts/sides/#writing-one-sided-mods). Understandably, those code changes may be non-trivial, so mod authors can also add "Client" to the game versions when publishing.
|
||||
|
||||
Some modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the `LEVEL` to the resulting saves directory by setting `CF_SET_LEVEL_FROM` to either:
|
||||
- `WORLD_FILE`
|
||||
- `OVERRIDES`
|
||||
|
||||
Other configuration available:
|
||||
- `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform
|
||||
- `CF_OVERRIDES_SKIP_EXISTING` (default is false): if set, files in the overrides that already exist in the data directory are skipped. **NOTE** world data is always skipped, if present.
|
||||
|
||||
### Old approach
|
||||
|
||||
Enable this server mode by adding `-e TYPE=CURSEFORGE` to your command-line,
|
||||
but note the following additional steps needed...
|
||||
|
||||
@@ -673,13 +747,13 @@ packwiz modpack defitions are processed before other mod definitions (`MODPACK`,
|
||||
There are optional volume paths that can be attached to supply content to be copied into the data area:
|
||||
|
||||
`/plugins`
|
||||
: contents are synchronized into `/data/plugins` for Bukkit related server types. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||
: contents are synchronized into `/data/plugins` for Bukkit related server types. The source can be changed by setting `COPY_PLUGINS_SRC`. The destination can be changed by setting `COPY_PLUGINS_DEST`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
|
||||
|
||||
`/mods`
|
||||
: contents are synchronized into `/data/mods` for Fabric and Forge related server types. The destination can be changed by setting `COPY_MODS_DEST`.
|
||||
: contents are synchronized into `/data/mods` for Fabric and Forge related server types. The source can be changed by setting `COPY_MODS_SRC`. The destination can be changed by setting `COPY_MODS_DEST`.
|
||||
|
||||
`/config`
|
||||
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. 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. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
|
||||
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. The source can be changed by setting `COPY_CONFIG_SRC`. 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. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
|
||||
|
||||
By default, the [environment variable processing](#replacing-variables-inside-configs) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.
|
||||
|
||||
@@ -719,6 +793,10 @@ For example, the following will auto-download the [EssentialsX](https://www.spig
|
||||
|
|
||||
+-- project slug
|
||||
```
|
||||
Also, specific version/type can be declared using colon symbol and version id/type after the project slug. The version id can be found at 'Metadata' section. Valid version types are `release`, `beta`, `alpha`. For instance:
|
||||
```
|
||||
-e MODRINTH_PROJECTS=fabric-api,fabric-api:PbVeub96,fabric-api:beta
|
||||
```
|
||||
- **MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES**=true : required dependencies of the project will _always_ be downloaded and optional dependencies can also be downloaded by setting this to `true`
|
||||
- **MODRINTH_ALLOWED_VERSION_TYPE**=release : the version type is used to determine the newest version to use from each project. The allowed values are `release`, `beta`, `alpha`.
|
||||
|
||||
@@ -1824,6 +1902,10 @@ To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags
|
||||
|
||||
> If experiencing issues such as "sleep: cannot read realtime clock: Operation not permitted", ensure `libseccomp` is up to date on your host. In some cases adding `:Z` flag to the `/data` mount may be needed, [but use cautiously](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label).
|
||||
|
||||
## Mitigated Log4jShell Vulnerability
|
||||
|
||||
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [Development](DEVELOPMENT.md) and [Building](BUILDING.md).
|
||||
|
||||
1
docs/.gitignore
vendored
Normal file
1
docs/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/.*.bkp
|
||||
BIN
docs/Going from docker run to compose.drawio.png
Normal file
BIN
docs/Going from docker run to compose.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
BIN
docs/cf-file-id.png
Normal file
BIN
docs/cf-file-id.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
docs/cf-project-id.png
Normal file
BIN
docs/cf-project-id.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
docs/cf-slug.png
Normal file
BIN
docs/cf-slug.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 72 KiB |
2
examples/.gitignore
vendored
2
examples/.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
/data/
|
||||
data/
|
||||
modpacks/
|
||||
18
examples/atm8/docker-compose.yml
Normal file
18
examples/atm8/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||
CF_FILENAME_MATCHER: "1.0.6"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
@@ -5,15 +5,13 @@ services:
|
||||
container_name: paper
|
||||
environment:
|
||||
EULA: "true"
|
||||
ENABLE_RCON: "true"
|
||||
TYPE: PAPER
|
||||
VIEW_DISTANCE: 10
|
||||
MEMORY: 2G
|
||||
CONSOLE: "false"
|
||||
ports:
|
||||
- 25565:25565
|
||||
- "25565:25565"
|
||||
volumes:
|
||||
- mc-paper:/data
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
mc-paper:
|
||||
mc-paper: {}
|
||||
|
||||
@@ -6,7 +6,7 @@ services:
|
||||
tty: true
|
||||
stdin_open: true
|
||||
ports:
|
||||
- 25565:25565
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
volumes:
|
||||
|
||||
13
examples/modrinth-paper/docker-compose.yml
Normal file
13
examples/modrinth-paper/docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: PAPER
|
||||
VERSION: 1.19.3
|
||||
MODRINTH_PROJECTS: "coreprotect"
|
||||
MODRINTH_ALLOWED_VERSION_TYPE: "release"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
19
examples/one-block-modded/docker-compose.yml
Normal file
19
examples/one-block-modded/docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/one-block-modded/files/4136487"
|
||||
CF_SET_LEVEL_FROM: OVERRIDES
|
||||
DEBUG: "false"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
18
examples/pixelmon/docker-compose.yml
Normal file
18
examples/pixelmon/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server:java8-multiarch
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
CF_SLUG: the-pixelmon-modpack
|
||||
CF_FILENAME_MATCHER: "9.1.2"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
18
examples/vault-hunters-1-18-2/docker-compose.yml
Normal file
18
examples/vault-hunters-1-18-2/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
CF_SLUG: vault-hunters-1-18-2
|
||||
CF_FILENAME_MATCHER: "Update-6H"
|
||||
MEMORY: 4G
|
||||
volumes:
|
||||
- mc-data:/data
|
||||
|
||||
volumes:
|
||||
mc-data: {}
|
||||
@@ -10,9 +10,7 @@ fi
|
||||
|
||||
autopause_error_loop() {
|
||||
logAutopause "Available interfaces within the docker container:"
|
||||
INTERFACES=$(echo /sys/class/net/*)
|
||||
INTERFACES=${INTERFACES//\/sys\/class\/net\//}
|
||||
logAutopause " $INTERFACES"
|
||||
logAutopause " $(mc-image-helper network-interfaces)"
|
||||
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
|
||||
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
|
||||
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
|
||||
@@ -37,7 +35,7 @@ if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
if ! [[ -d "/sys/class/net/$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
if ! mc-image-helper network-interfaces --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
|
||||
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
|
||||
@@ -23,7 +23,9 @@ mc_server_listening() {
|
||||
java_clients_connections() {
|
||||
local connections
|
||||
if java_running ; then
|
||||
connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count)
|
||||
if ! connections=$(mc-monitor status --host localhost --port "$SERVER_PORT" --show-player-count); then
|
||||
connections=0
|
||||
fi
|
||||
else
|
||||
connections=0
|
||||
fi
|
||||
@@ -32,4 +34,4 @@ java_clients_connections() {
|
||||
|
||||
java_clients_connected() {
|
||||
(( $(java_clients_connections) > 0 ))
|
||||
}
|
||||
}
|
||||
28
files/cf-exclude-include.json
Normal file
28
files/cf-exclude-include.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"globalExcludes": [
|
||||
"carry-on",
|
||||
"defensive-measures",
|
||||
"dynamiclights-reforged",
|
||||
"entity-texture-features-fabric",
|
||||
"entityculling",
|
||||
"extreme-sound-muffler",
|
||||
"ignitioncoil",
|
||||
"legendary-tooltips",
|
||||
"nekos-enchanted-books",
|
||||
"not-enough-animations",
|
||||
"oculus",
|
||||
"rubidium",
|
||||
"rubidium-extra",
|
||||
"magnesium-extras",
|
||||
"skin-layers-3d",
|
||||
"textrues-rubidium-options",
|
||||
"torohealth-damage-indicators"
|
||||
],
|
||||
"modpacks": {
|
||||
"all-of-fabric-6": {
|
||||
"forceIncludes": [
|
||||
"revelationary"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,11 +136,11 @@ cd /data || exit 1
|
||||
export ORIGINAL_TYPE=${TYPE^^}
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
${SCRIPTS:-/}start-autopause
|
||||
"${SCRIPTS:-/}start-autopause"
|
||||
fi
|
||||
|
||||
if isTrue "${ENABLE_AUTOSTOP}"; then
|
||||
${SCRIPTS:-/}start-autostop
|
||||
"${SCRIPTS:-/}start-autostop"
|
||||
fi
|
||||
|
||||
if
|
||||
@@ -152,7 +152,7 @@ if
|
||||
then
|
||||
log "Starting RCON commands"
|
||||
# shellcheck source=start-rconcmds
|
||||
${SCRIPTS:-/}start-rconcmds
|
||||
"${SCRIPTS:-/}start-rconcmds"
|
||||
fi
|
||||
|
||||
if versionLessThan 1.7; then
|
||||
@@ -196,6 +196,10 @@ case "${TYPE^^}" in
|
||||
exec "${SCRIPTS:-/}start-deployCF" "$@"
|
||||
;;
|
||||
|
||||
AUTO_CURSEFORGE)
|
||||
exec "${SCRIPTS:-/}start-deployAutoCF" "$@"
|
||||
;;
|
||||
|
||||
VANILLA)
|
||||
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
|
||||
;;
|
||||
|
||||
72
scripts/start-deployAutoCF
Normal file
72
scripts/start-deployAutoCF
Normal file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
: "${CF_PAGE_URL:=}"
|
||||
: "${CF_SLUG:=}"
|
||||
: "${CF_FILE_ID:=}"
|
||||
: "${CF_FILENAME_MATCHER:=}"
|
||||
: "${CF_PARALLEL_DOWNLOADS:=4}"
|
||||
: "${CF_FORCE_SYNCHRONIZE:=false}"
|
||||
: "${CF_EXCLUDE_INCLUDE_FILE:=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
|
||||
: "${CF_EXCLUDE_MODS:=}"
|
||||
: "${CF_FORCE_INCLUDE_MODS:=}"
|
||||
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
||||
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
|
||||
|
||||
|
||||
resultsFile=/data/.install-curseforge.env
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
args=(
|
||||
--results-file="$resultsFile"
|
||||
)
|
||||
if [[ $CF_PAGE_URL ]]; then
|
||||
args+=(--modpack-page-url="$CF_PAGE_URL")
|
||||
fi
|
||||
if [[ $CF_FILE_ID ]]; then
|
||||
args+=(--file-id="$CF_FILE_ID")
|
||||
fi
|
||||
if [[ $CF_SLUG ]]; then
|
||||
args+=(--slug="$CF_SLUG")
|
||||
fi
|
||||
if [[ $CF_FILENAME_MATCHER ]]; then
|
||||
args+=(--filename-matcher="$CF_FILENAME_MATCHER")
|
||||
fi
|
||||
if [[ ${CF_SET_LEVEL_FROM} ]]; then
|
||||
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
|
||||
fi
|
||||
args+=(
|
||||
--parallel-downloads="$CF_PARALLEL_DOWNLOADS"
|
||||
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
|
||||
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
||||
)
|
||||
|
||||
if [[ $CF_EXCLUDE_MODS || $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
if [[ $CF_EXCLUDE_MODS ]]; then
|
||||
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
|
||||
fi
|
||||
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
|
||||
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
|
||||
fi
|
||||
else
|
||||
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
|
||||
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
||||
log "ERROR failed to auto-install CurseForge modpack"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# grab SERVER, FAMILY and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
set +a
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
@@ -4,47 +4,49 @@ set -eu
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
export TYPE=FABRIC
|
||||
: "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}"
|
||||
: "${FABRIC_LAUNCHER:=}"
|
||||
: "${FABRIC_LAUNCHER_URL:=}"
|
||||
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
||||
|
||||
resultsFile=/data/.install-fabric.env
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
# Custom fabric jar
|
||||
if [[ $FABRIC_LAUNCHER ]]; then
|
||||
export SERVER=${FABRIC_LAUNCHER}
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
--from-local-file="$FABRIC_LAUNCHER"; then
|
||||
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER"
|
||||
exit 1
|
||||
fi
|
||||
# Custom fabric jar url
|
||||
elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
||||
export SERVER=fabric-server-$(echo -n "$FABRIC_LAUNCHER_URL" | mc-image-helper hash)
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
--from-url="$FABRIC_LAUNCHER_URL"; then
|
||||
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER_URL"
|
||||
exit 1
|
||||
fi
|
||||
# Official fabric launcher
|
||||
else
|
||||
if [[ ${FABRIC_LAUNCHER_VERSION^^} = LATEST ]]; then
|
||||
log "Checking Fabric Launcher version information."
|
||||
FABRIC_LAUNCHER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
fi
|
||||
if [[ ${FABRIC_LOADER_VERSION^^} = LATEST ]]; then
|
||||
log "Checking Fabric Loader version information."
|
||||
FABRIC_LOADER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml)
|
||||
fi
|
||||
export SERVER=fabric-server-mc.${VANILLA_VERSION}-loader.${FABRIC_LOADER_VERSION}-launcher.${FABRIC_LAUNCHER_VERSION}.jar
|
||||
export FABRIC_LAUNCHER_URL="https://meta.fabricmc.net/v2/versions/loader/${VANILLA_VERSION}/${FABRIC_LOADER_VERSION}/${FABRIC_LAUNCHER_VERSION}/server/jar"
|
||||
fi
|
||||
|
||||
if [[ ! -e ${SERVER} && ! -z ${FABRIC_LAUNCHER_URL} ]]; then
|
||||
log "Downloading $FABRIC_LAUNCHER_URL ..."
|
||||
if ! get -o "$SERVER" "$FABRIC_LAUNCHER_URL"; then
|
||||
log "Failed to download from given location $FABRIC_LAUNCHER_URL"
|
||||
exit 2
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
--minecraft-version="${VANILLA_VERSION}" \
|
||||
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
|
||||
--loader-version="${FABRIC_LOADER_VERSION}"; then
|
||||
log "ERROR failed to install Fabric launcher from $VANILLA_VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -e ${SERVER} ]]; then
|
||||
log "$SERVER does not exist, cannot launch server!"
|
||||
exit 1
|
||||
fi
|
||||
# grab SERVER and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
set +a
|
||||
|
||||
export FAMILY=FABRIC
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
||||
@@ -7,16 +7,31 @@
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
if ! mc-image-helper install-forge \
|
||||
--output-directory=/data \
|
||||
--results-file=/data/.run-forge.env \
|
||||
--minecraft-version="${VANILLA_VERSION}" \
|
||||
--forge-version="${FORGE_VERSION}" \
|
||||
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
|
||||
log "ERROR failed to install forge"
|
||||
exit 1
|
||||
if [[ ${FORGE_INSTALLER} ]]; then
|
||||
if ! mc-image-helper install-forge \
|
||||
--output-directory=/data \
|
||||
--results-file=/data/.run-forge.env \
|
||||
--minecraft-version="${VANILLA_VERSION}" \
|
||||
--forge-installer="${FORGE_INSTALLER}" \
|
||||
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
|
||||
log "ERROR failed to install Forge given installer ${FORGE_INSTALLER}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
if ! mc-image-helper install-forge \
|
||||
--output-directory=/data \
|
||||
--results-file=/data/.run-forge.env \
|
||||
--minecraft-version="${VANILLA_VERSION}" \
|
||||
--forge-version="${FORGE_VERSION}" \
|
||||
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
|
||||
log "ERROR failed to install Forge"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# grab SERVER and export it
|
||||
set -a
|
||||
source /data/.run-forge.env
|
||||
|
||||
@@ -183,7 +183,7 @@ esac
|
||||
fi
|
||||
}
|
||||
|
||||
function genericPacks() {
|
||||
function handleGenericPacks() {
|
||||
: "${GENERIC_PACKS:=${GENERIC_PACK}}"
|
||||
: "${GENERIC_PACKS_PREFIX:=}"
|
||||
: "${GENERIC_PACKS_SUFFIX:=}"
|
||||
@@ -267,16 +267,19 @@ function genericPacks() {
|
||||
fi
|
||||
}
|
||||
|
||||
function modrinthProjects() {
|
||||
function handleModrinthProjects() {
|
||||
: "${MODRINTH_PROJECTS:=}"
|
||||
: "${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES:=true}"
|
||||
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
|
||||
|
||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC; then
|
||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
||||
if isFamily HYBRID FORGE; then
|
||||
loader=forge
|
||||
elif isFaily FABRIC; then
|
||||
loader=fabric
|
||||
else
|
||||
loader="${FAMILY,,}"
|
||||
# we're left with Bukkit/Spigot down-lines where plugins seem to be
|
||||
loader="${TYPE,,}"
|
||||
fi
|
||||
mc-image-helper modrinth \
|
||||
--output-directory=/data \
|
||||
@@ -294,8 +297,8 @@ handleModpackListOrFile
|
||||
|
||||
handleCurseForgeManifest
|
||||
|
||||
genericPacks
|
||||
handleGenericPacks
|
||||
|
||||
modrinthProjects
|
||||
handleModrinthProjects
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupModconfig" "$@"
|
||||
|
||||
@@ -14,57 +14,62 @@
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
if isTrue ${SYNC_SKIP_NEWER_IN_DESTINATION}; then
|
||||
if isTrue "${SYNC_SKIP_NEWER_IN_DESTINATION}"; then
|
||||
updateArg="--skip-newer-in-destination"
|
||||
fi
|
||||
|
||||
if isTrue ${REPLACE_ENV_DURING_SYNC}; then
|
||||
if isTrue "${REPLACE_ENV_DURING_SYNC}"; then
|
||||
subcommand=sync-and-interpolate
|
||||
else
|
||||
subcommand=sync
|
||||
fi
|
||||
|
||||
if [ -d /plugins ]; then
|
||||
: "${COPY_PLUGINS_SRC:="/plugins"}"
|
||||
: "${COPY_PLUGINS_DEST:="/data/plugins"}"
|
||||
|
||||
if [ -d "${COPY_PLUGINS_SRC}" ]; then
|
||||
case ${FAMILY} in
|
||||
SPIGOT|HYBRID)
|
||||
mkdir -p /data/plugins
|
||||
log "Copying plugins over..."
|
||||
mkdir -p "${COPY_PLUGINS_DEST}"
|
||||
log "Copying any plugins from ${COPY_PLUGINS_SRC} to ${COPY_PLUGINS_DEST}"
|
||||
mc-image-helper \
|
||||
${subcommand} $updateArg \
|
||||
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
|
||||
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
|
||||
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
|
||||
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
|
||||
/plugins /data/plugins
|
||||
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
|
||||
"${COPY_PLUGINS_SRC}" "${COPY_PLUGINS_DEST}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
: "${COPY_MODS_SRC:="/mods"}"
|
||||
: "${COPY_MODS_DEST:="/data/mods"}"
|
||||
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
if [ -d "${COPY_MODS_SRC}" ]; then
|
||||
log "Copying any mods from ${COPY_MODS_SRC} to ${COPY_MODS_DEST}"
|
||||
mc-image-helper \
|
||||
${subcommand} $updateArg \
|
||||
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
|
||||
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
|
||||
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
|
||||
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
|
||||
/mods "${COPY_MODS_DEST}"
|
||||
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
|
||||
"${COPY_MODS_SRC}" "${COPY_MODS_DEST}"
|
||||
fi
|
||||
|
||||
: "${COPY_CONFIG_SRC:="/config"}"
|
||||
: "${COPY_CONFIG_DEST:="/data/config"}"
|
||||
|
||||
if [ -d /config ]; then
|
||||
log "Copying any configs from /config to ${COPY_CONFIG_DEST}"
|
||||
if [ -d "${COPY_CONFIG_SRC}" ]; then
|
||||
log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}"
|
||||
mc-image-helper \
|
||||
${subcommand} $updateArg \
|
||||
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
|
||||
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
|
||||
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
|
||||
--replace-env-prefix=${REPLACE_ENV_VARIABLE_PREFIX} \
|
||||
/config "${COPY_CONFIG_DEST}"
|
||||
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
|
||||
"${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}"
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupServerProperties" "$@"
|
||||
|
||||
16
tests/setuponlytests/auto_curseforge/docker-compose.yml
Normal file
16
tests/setuponlytests/auto_curseforge/docker-compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "true"
|
||||
SETUP_ONLY: "TRUE"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
CF_SLUG: the-pixelmon-modpack
|
||||
CF_FILENAME_MATCHER: "9.1.2"
|
||||
# Use the image bundled one to ensure latest is being tested
|
||||
CF_EXCLUDE_INCLUDE_FILE: /image/cf-exclude-include.json
|
||||
volumes:
|
||||
- ./data:/data
|
||||
|
||||
2
tests/setuponlytests/auto_curseforge/verify.sh
Normal file
2
tests/setuponlytests/auto_curseforge/verify.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
mc-image-helper assert fileExists "/data/mods/ExplorersCompass-1.16.5-1.1.2-forge.jar"
|
||||
mc-image-helper assert fileExists "/data/forge-1.16.5-36.2.34.jar"
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
21
tests/setuponlytests/mounts-custom/docker-compose.yml
Normal file
21
tests/setuponlytests/mounts-custom/docker-compose.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "true"
|
||||
SETUP_ONLY: "true"
|
||||
TYPE: CUSTOM
|
||||
CUSTOM_SERVER: /servers/fake.jar
|
||||
VERSION: 1.18.1
|
||||
COPY_PLUGINS_SRC: /custom/plugins
|
||||
COPY_PLUGINS_DEST: /data/custom-plugins
|
||||
COPY_MODS_SRC: /custom/mods
|
||||
COPY_MODS_DEST: /data/custom-mods
|
||||
COPY_CONFIG_SRC: /custom/config
|
||||
COPY_CONFIG_DEST: /data/custom-config
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./custom:/custom
|
||||
- ./fake.jar:/servers/fake.jar
|
||||
0
tests/setuponlytests/mounts-custom/fake.jar
Normal file
0
tests/setuponlytests/mounts-custom/fake.jar
Normal file
3
tests/setuponlytests/mounts-custom/verify.sh
Normal file
3
tests/setuponlytests/mounts-custom/verify.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
mc-image-helper assert fileExists custom-plugins/plugin.jar
|
||||
mc-image-helper assert fileExists custom-mods/mod.jar
|
||||
mc-image-helper assert fileExists custom-config/test.json
|
||||
Reference in New Issue
Block a user