Compare commits

...

24 Commits

Author SHA1 Message Date
Chip Wolf ‮
46a09ed331 Add option to skip generic pack checksum (#1816) 2022-11-10 07:05:47 -06:00
Geoff Bourne
0d9bfa6478 Document command to find host path of anonymous volume (#1811) 2022-10-30 09:08:58 -05:00
kylekrejci
885a921b08 Remove duplicate VIEW_DISTANCE env variable (#1808) 2022-10-29 14:04:47 -05:00
Geoff Bourne
5e2553274f Added kustomize base files (#1800) 2022-10-23 22:00:16 -05:00
Geoff Bourne
1769f28015 Added example of INITIAL_ENABLED_PACKS (#1799) 2022-10-22 20:52:36 -05:00
Geoff Bourne
17cf058aa4 Added support for datapack enable/disable properties for feature flags (#1798) 2022-10-22 15:30:08 -05:00
Phongsakorn Wisetthon
ad912fe7bf Using spiget, if REMOVE_OLD_MODS = true redownload plugins (#1792) 2022-10-22 15:04:28 -05:00
dependabot[bot]
c46890f9b1 build(deps): bump docker/build-push-action from 3.1.1 to 3.2.0 (#1790) 2022-10-17 09:10:02 -05:00
dependabot[bot]
c4015f4ccb build(deps): bump docker/setup-qemu-action from 2.0.0 to 2.1.0 (#1789) 2022-10-17 07:47:36 -05:00
Geoff Bourne
c1d8dc9bb0 Improved naming of FORGE_FORCE_REINSTALL and FORGE_VERSION (#1788) 2022-10-16 17:49:25 -05:00
Geoff Bourne
2e69966a6a Emphasize java 8 requirement for Forge < 1.18 (#1787) 2022-10-15 15:19:23 -05:00
Geoff Bourne
ec06e3bfeb Added more description of DATAPACKS variables (#1784) 2022-10-14 15:36:53 -05:00
Geoff Bourne
1c9e31c630 Only default MOTD and WHITELIST when first creating server.properties (#1780) 2022-10-12 22:09:56 -05:00
Geoff Bourne
8f5cc315d9 Setup MEMORY variables earlier to allow use in Spigot build (#1779) 2022-10-12 19:23:01 -05:00
Geoff Bourne
61592d5c3e Prevent generic modpack overwriting eula file (#1773) 2022-10-08 18:25:42 -05:00
Geoff Bourne
57dc84e204 Auto-manage server properties by default (#1769) 2022-10-08 18:11:43 -05:00
Geoff Bourne
c61df8d32e Updated docs for finding FTB modpack ID (#1766) 2022-10-07 21:44:18 -05:00
Geoff Bourne
c228465ff1 Added ARMv7 build for java8-multiarch (#1765) 2022-10-07 21:19:08 -05:00
J Thompson
1b44fc87dd Remove packwiz 403 readme documentation (#1763) 2022-10-07 07:12:06 -05:00
J Thompson
7076fb83da BetterMC Plus Example (#1762) 2022-10-06 07:44:12 -05:00
J Thompson
5338f1e0f4 Create docker-compose-curseforge-atm7.yaml (#1761) 2022-10-05 21:44:13 -05:00
dependabot[bot]
8ab5542c82 build(deps): bump actions/stale from 5 to 6 (#1751) 2022-09-26 08:06:01 -05:00
Geoff Bourne
96a21ff6e6 Upgrade mc-monitor to allow option to use mcutils for long FML2 listings (#1746) 2022-09-22 20:44:51 -05:00
Geoff Bourne
a57d678fdd Allow image helper get to use user info (#1735) 2022-09-17 10:45:41 -05:00
25 changed files with 533 additions and 132 deletions

13
.github/release.yml vendored
View File

@@ -2,3 +2,16 @@ changelog:
exclude:
authors:
- dependabot
categories:
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"

View File

@@ -77,7 +77,7 @@ jobs:
mcVersion: 1.12.2
- variant: java8-multiarch
baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.12.2
- variant: java8-jdk
baseImage: eclipse-temurin:8u312-b07-jdk-focal
@@ -119,10 +119,10 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
uses: docker/setup-qemu-action@v2.1.0
- name: Build for test
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
@@ -152,7 +152,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
if: github.actor == github.repository_owner
with:
platforms: ${{ matrix.platforms }}

View File

@@ -12,7 +12,7 @@ jobs:
pull-requests: write
steps:
- name: Process Stale Issues
uses: actions/stale@v5
uses: actions/stale@v6
with:
stale-issue-label: status/stale
stale-pr-label: status/stale

View File

@@ -46,7 +46,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Build for test
uses: docker/build-push-action@v3.1.1
uses: docker/build-push-action@v3.2.0
with:
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}

View File

@@ -35,7 +35,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=0.10.3 --var app=mc-monitor --file {{.app}} \
--var version=0.11.0 --var app=mc-monitor --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} \
@@ -46,7 +46,7 @@ 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.6
ARG MC_HELPER_VERSION=1.22.7
ARG MC_HELPER_RELEASE=v${MC_HELPER_VERSION}
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_RELEASE}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \

View File

@@ -142,6 +142,16 @@ Now you can recreate the container with any environment variable changes, etc by
docker run -d -it --name mc-new -v mc:/data -p 25565:25565 -e EULA=TRUE -e MEMORY=2G itzg/minecraft-server
```
### Locating filesystem path of anonymous volume
The `Source` field from the output of this command will show where the anonymous volume is mounted from:
```shell
docker inspect -f "{{json .Mounts}}" CONTAINER_NAME_OR_ID
```
> **NOTE** On Windows with WSL the volumes path is `\\wsl$\docker-desktop-data\data\docker\volumes`
## Versions
To use a different Minecraft version, pass the `VERSION` environment variable (case sensitive), which can have the value
@@ -165,6 +175,8 @@ the server jar remain in the `/data` directory. It is safe to remove those._
## Running Minecraft server on different Java version
> **For Forge versions less than 1.18, you _must_ use the `java8-multiarch` (or other java8) image tag.**
When using the image `itzg/minecraft-server` without a tag, the `latest` image tag is implied from the table below. To use a different version of Java, please use an alternate tag to run your Minecraft server container.
| Tag name | Java version | Linux | JVM Type | Architecture |
@@ -324,11 +336,11 @@ To troubleshoot any issues with memory allocation reported by the JVM, set the e
Enable [Forge server](http://www.minecraftforge.net/) mode by adding a `-e TYPE=FORGE` to your command-line.
The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGEVERSION`, such as `-e FORGEVERSION=14.23.5.2854`.
The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGE_VERSION`, such as `-e FORGE_VERSION=14.23.5.2854`.
docker run -d -v /path/on/host:/data \
-e TYPE=FORGE \
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
-e VERSION=1.12.2 -e FORGE_VERSION=14.23.5.2854 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
@@ -345,6 +357,8 @@ the URL with `FORGE_INSTALLER_URL`, such as:
In both of the cases above, there is no need for the `VERSION` or `FORGEVERSION` variables.
> If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
### Running a Fabric Server
Enable [Fabric server](https://fabricmc.net/) mode by adding a `-e TYPE=FABRIC` to your command-line.
@@ -568,8 +582,12 @@ Crucible is only available for 1.7.10, so be sure to set `VERSION=1.7.10`.
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by using `-e TYPE=FTBA` (**note** the "A" at the end of the type). This server type will automatically take care of downloading and installing the modpack and appropriate version of Forge, so the `VERSION` does not need to be specified.
### Environment Variables:
- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by [finding the modpack](https://www.feed-the-beast.com/modpack) and hovering over the name of the modpack, [as shown here](docs/ftba-identifier-popup.png).
- `FTB_MODPACK_VERSION_ID`: optional, the numerical Id of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by drilling into the Versions tab and hovering over the version name, [as shown here](docs/ftba-version-id-popup.png).
- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by [finding the modpack](https://www.feed-the-beast.com/modpack) and locating the ID in this part of the URL:
```
https://www.feed-the-beast.com/modpacks/23-ftb-infinity-evolved-17
^^
```
- `FTB_MODPACK_VERSION_ID`: optional, the numerical ID of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by hovering over a server file entry and grabbing [this ID in the URL](docs/ftba-version-id-popup.png).
### Upgrading
@@ -646,40 +664,6 @@ packwiz modpack defitions are processed before other mod definitions (`MODPACK`,
> packwiz is pre-configured to only download server mods. If client-side mods are downloaded and cause issues, check your pack.toml configuration, and make sure any client-only mods are not set to `"both"`, but rather `"client"` for the side configuration item.
### Known Issues: Curl 403 on Startup
If the container enters a crash-loop or is otherwise rate-limited by Github, you
will see an error similar to, `curl: (22) The requested URL returned error: 403`.
Packwiz is primarily distributed through Github releases. In order to check if
there are any new releases, this container must call Githubs API. All of the
data that we need to check is public, but trouble happens when Github has reason
to think these calls are a bad-actor. Like if the container gets stuck in a loop
restarting and calls the API too fast or too many times. Simply, this container uses
personal access tokens to tells Github that this system is built by a friendly
human.
[Manage Your Github's Personal Access Tokens](https://github.com/settings/tokens)
Create a new personal access token for this container to use. This token will
be used everytime the container is started or restarted so choose an expiration
date that will last for as long as you plan to be operating this container
instance. **The token cannot have any scopes.** This script doesn't need any
scopes what-so-ever to Github and is only being used to signal to Github that
a friendly human is requesting some data. **Do NOT give this token scopes. This
container will refuse to use any token with scopes.**
To configure server mods using a packwiz modpack and a github token, set the
`PACKWIZ_URL` environment variable to the location of your `pack.toml` modpack
definition and the `GH_TOKEN` to your token's secret value:
docker run -d -v /path/on/host:/data \
-p 25565:25565 \
-e TYPE=FORGE \
-e "PACKWIZ_URL=https://example.com/modpack/pack.toml" \
-e "GH_TOKEN"=ghp_chaosofrandomdigitsandletters \
itzg/minecraft-server
## Working with mods and plugins
### Optional plugins, mods, and config attach points
@@ -831,7 +815,9 @@ GENERIC_PACKS_SUFFIX=.zip
would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`.
If applying large generic packs, the update check can be time-consuming since a SHA1 checksum is compared. To skip the update check set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied without comparing the checksum by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
If applying large generic packs, the update can be time-consuming. To skip the update set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied by setting `FORCE_GENERIC_PACK_UPDATE` to "true".
The most time consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true.
### Mod/Plugin URL Listing File
@@ -906,12 +892,14 @@ docker run -d -e EXTRA_ARGS='--world-dir ./worlds/'
### Datapacks
Datapacks can be installed in a similar manner to mods/plugins. There are many environment variables which function in the same way they do for [mods](#working-with-mods-and-plugins):
* `DATAPACKS`
* `DATAPACKS_FILE`
* `REMOVE_OLD_DATAPACKS`
* `REMOVE_OLD_DATAPACKS_DEPTH`
* `REMOVE_OLD_DATAPACKS_INCLUDE`
* `REMOVE_OLD_DATAPACKS_EXCLUDE`
* `DATAPACKS`: comma-separated list of zip file URL, zip file in container, or directory in container
* `DATAPACKS_FILE`: a text file within the container where each line is a zip file URL, zip file in container, or directory in container
* `REMOVE_OLD_DATAPACKS`: if "true" the datapacks directory is removed of everything matching `REMOVE_OLD_DATAPACKS_INCLUDE`, but excluding `REMOVE_OLD_DATAPACKS_EXCLUDE` no deeper than `REMOVE_OLD_DATAPACKS_DEPTH`
* `REMOVE_OLD_DATAPACKS_DEPTH`: default is 16
* `REMOVE_OLD_DATAPACKS_INCLUDE`: default is `*.zip`
* `REMOVE_OLD_DATAPACKS_EXCLUDE`: default is empty
Datapacks will be placed in `/data/$LEVEL/datapacks`
### VanillaTweaks
@@ -990,13 +978,7 @@ CraftingTweaks Json:
By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed.
If you would like to override the server configuration each time the container starts up, you can set the `OVERRIDE_SERVER_PROPERTIES` environment variable like:
docker run -d -e OVERRIDE_SERVER_PROPERTIES=true ...
This will reset any manual configuration of the `server.properties` file, so if you want to make any persistent configuration changes you will need to make sure you have properly set the proper environment variables in your container configuration.
In the opposite case, you can skip the startup script's creation of `server.properties`, by setting `SKIP_SERVER_PROPERTIES` to "true".
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".
> NOTE: to clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. A variables that maps to a server property that is unset, is ignored and the existing `server.property` is left unchanged.
@@ -1064,6 +1046,14 @@ If ops configuration already exists, `OPS_FILE` will not be retrieved and any us
> Similar to whitelists, you can provide both `OPS_FILE` and `OPS`, and Minecraft 1.7.5 or earlier will use `ops.txt` rather than `ops.json`.
### Enable/disable initial selection of datapacks
New to [22W42A](https://www.minecraft.net/en-us/article/minecraft-snapshot-22w42a), datapacks with feature flags can be controlled before initial world creation by setting these to a comma separated list of packs:
- `INITIAL_ENABLED_PACKS`
such as "update_1_20,bundle"
- `INITIAL_DISABLED_PACKS`
### Server icon
A server icon can be configured using the `ICON` variable. The image will be automatically

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

@@ -0,0 +1,150 @@
version: '3.8'
####################################################################
# CURSEFORGE #
# #
# Date: 20221005 #
# #
# Mod: All The Mods 7 0.4.32 #
# #
# Notes: Verify that there is no EULA file in the modpack.zip #
# if you do not delete it the EULA flag below will be #
# overwritten when the modpack is copied. #
# #
####################################################################
services:
####################################################################
# Service Name #
# #
# Define Service Name here. If using RCON this name will be #
# referenced again as RWA_RCON_HOST below. #
# #
# Example: 'name:' or 'mc_atm6:' #
####################################################################
mc_atm7:
####################################################################
# Image & Container Name #
# #
# Specify Image Name and Java Version. The 'image' will always be #
# 'itzg/minecraft-server' however the tag added to the end is #
# where you can specify the java version or container architecture.#
# See readme.md for a full list. #
# #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands. #
####################################################################
image: itzg/minecraft-server
container_name: mc_atm7
####################################################################
# Server Ports #
# #
# Specify external port. #
####################################################################
ports:
- 25565:25565
####################################################################
# Automatic Server Restart #
# #
# Define a restart policy here. #
# - 'no' = Do not restart. #
# - 'on-failure' = Restart if container exits because an error. #
# - 'always' = Regardless of stop reason. #
# - 'unless-stopped' = Similar to always except if stopped. #
####################################################################
restart: unless-stopped
####################################################################
# Volume and Folder Access #
# #
# This section defines what folders and volumes you want to give #
# this container access to. It is recommended to leaves these set #
# to the default values unless you know what you are doing. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
# #
# Specify the data volume name or directory here as well. #
# In this example the volume name is 'data'. When docker creates #
# the volume it will add what ever name you give it here to the #
# end of the container name specified above. In this example it #
# would be named 'mc_atm6_data'. If you change this be sure to #
# update the volume name at the bottom of this config. #
####################################################################
volumes:
- ./modpacks:/modpacks:ro
- data:/data
####################################################################
# EULA #
# #
# Accept EULA by setting to "true" #
####################################################################
environment:
EULA: "true"
####################################################################
# CURSEFORGE INSTALL #
# #
# Sets install type to FORGE and specifys the zip folder name #
# and location of your mod pack. #
# #
# TYPE: Defines the install type as CURSEFORGE #
# #
# CF_SERVER_MOD: Define where the modpack.zip is located. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
####################################################################
TYPE: CURSEFORGE
CF_SERVER_MOD: /modpacks/ATM7-0.4.32-server.zip
####################################################################
# Server Memory #
# #
# Set Maximum amount of memory allowed for your server. #
####################################################################
MEMORY: "8G"
####################################################################
# Logging Options #
# #
# Set to "true" to delete old logs #
####################################################################
ENABLE_ROLLING_LOGS: "true"
####################################################################
# Server Timezone #
# #
# Specify server Timezone #
####################################################################
TZ: "America/New_York"
####################################################################
# Minecraft Game Options #
# #
# List any game options you want to define here. A full list can #
# be found on the readme.md page on github. #
####################################################################
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "easy"
MAX_TICK_TIME: "-1"
ALLOW_FLIGHT: "true"
OPS: ""
VIEW_DISTANCE: 10
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"
MOTD: "Welcome Home"
####################################################################
# Volumes #
# #
# Define data volume name here. You should leave this set to the #
# default. #
####################################################################
volumes:
data:

View File

@@ -0,0 +1,161 @@
version: '3.8'
####################################################################
# FORGE_GENERIC_PACK #
# #
# Date: 20221005 #
# #
# Mod: Better Minecraft Plus v40 #
# #
# Game Version: 1.16.5 #
# #
# Notes: Verify that there is no EULA file in the modpack.zip #
# if you do not delete it the EULA flag below will be #
# overwritten when the modpack is copied. #
# #
####################################################################
services:
####################################################################
# Service Name #
# #
# Define Service Name here. If using RCON this name will be #
# referenced again as RWA_RCON_HOST below. #
# #
# Example: 'name:' or 'mc_atm6:' #
####################################################################
mc_bmp:
####################################################################
# Image & Container Name #
# #
# Specify Image Name and Java Version. The 'image' will always be #
# 'itzg/minecraft-server' however the tag added to the end is #
# where you can specify the java version or container architecture.#
# See readme.md for a full list. #
# #
# 'container_name:' This can be anything you like. This is the name#
# that will show when you run 'docker ps' commands. #
####################################################################
image: itzg/minecraft-server:java8
container_name: mc_bmp
####################################################################
# Server Ports #
# #
# Specify external port. #
####################################################################
ports:
- 25565:25565
####################################################################
# Automatic Server Restart #
# #
# Define a restart policy here. #
# - 'no' = Do not restart. #
# - 'on-failure' = Restart if container exits because an error. #
# - 'always' = Regardless of stop reason. #
# - 'unless-stopped' = Similar to always except if stopped. #
####################################################################
restart: unless-stopped
####################################################################
# Volume and Folder Access #
# #
# This section defines what folders and volumes you want to give #
# this container access to. It is recommended to leaves these set #
# to the default values unless you know what you are doing. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
# #
# Specify the data volume name or directory here as well. #
# In this example the volume name is 'data'. When docker creates #
# the volume it will add what ever name you give it here to the #
# end of the container name specified above. In this example it #
# would be named 'mc_atm6_data'. If you change this be sure to #
# update the volume name at the bottom of this config. #
####################################################################
volumes:
- ./modpacks:/modpacks:ro
- data:/data
####################################################################
# EULA #
# #
# Accept EULA by setting to "true" #
####################################################################
environment:
EULA: "true"
####################################################################
# FORGE INSTALL #
# #
# Sets install type to FORGE and specifys the zip folder name #
# and location of your mod pack. #
# #
# TYPE: Defines the install type as FORGE #
# #
# VERSION: Defines the version of MC the modpack is based on. #
# #
# FORGE_VERSION: Defines the version of FORGE the modpack uses. #
# This can usually be found in the modpack.zip as #
# installer.jar #
# #
# GENERIC_PACK: Define where the modpack.zip is located. #
# #
# Place your mod zip file in a folder called 'modpacks' in the #
# same directory you place this docker-compose file. #
####################################################################
TYPE: FORGE
VERSION: 1.16.5
FORGE_VERSION: 36.2.39
GENERIC_PACK: /modpacks/Better+MC+Server+Pack+PLUS+1.16.5+v40+HF.zip
####################################################################
# Server Memory #
# #
# Set Maximum amount of memory allowed for your server. #
####################################################################
MEMORY: "8G"
####################################################################
# Logging Options #
# #
# Set to "true" to delete old logs #
####################################################################
ENABLE_ROLLING_LOGS: "true"
####################################################################
# Server Timezone #
# #
# Specify server Timezone #
####################################################################
TZ: "America/New_York"
####################################################################
# Minecraft Game Options #
# #
# List any game options you want to define here. A full list can #
# be found on the readme.md page on github. #
####################################################################
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "easy"
MAX_TICK_TIME: "-1"
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
OPS: ""
VIEW_DISTANCE: 10
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"
MOTD: "Welcome Home"
####################################################################
# Volumes #
# #
# Define data volume name here. You should leave this set to the #
# default. #
####################################################################
volumes:
data:

View File

@@ -1,19 +0,0 @@
version: '3.8'
services:
mc:
image: itzg/minecraft-server
volumes:
- ./data:/data
- ./modpacks:/modpacks:ro
environment:
EULA: "true"
MEMORY: 2G
TYPE: FORGE
VERSION: 1.18.2
FORGEVERSION: 40.1.30
# Need to download Server-Files-0.4.13.zip and
# put it in modpacks directory next to this compose file
GENERIC_PACK: /modpacks/Server-Files-0.4.13.zip
ports:
- "25565:25565"

View File

@@ -97,7 +97,7 @@ services:
# #
# VERSION: Defines the version of MC the modpack is based on. #
# #
# FORGEVERSION: Defines the version of FORGE the modpack uses. #
# FORGE_VERSION: Defines the version of FORGE the modpack uses. #
# This can usually be found in the modpack.zip as #
# installer.jar #
# #
@@ -108,7 +108,7 @@ services:
####################################################################
TYPE: FORGE
VERSION: 1.18.2
FORGEVERSION: 40.1.73
FORGE_VERSION: 40.1.73
GENERIC_PACK: /modpacks/tnp5.zip
####################################################################
@@ -144,7 +144,6 @@ services:
VIEW_DISTANCE: "6"
ALLOW_FLIGHT: "true"
OPS: ""
VIEW_DISTANCE: 10
MAX_PLAYERS: 10
PVP: "false"
LEVEL_TYPE: "biomesoplenty"

View File

@@ -11,7 +11,7 @@ services:
TYPE: FORGE
DEBUG: "${DEBUG:-false}"
VERSION: ${VERSION:-1.17.1}
FORGEVERSION: ${FORGEVERSION:-37.0.90}
FORGE_VERSION: ${FORGE_VERSION:-37.0.90}
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
REMOVE_OLD_MODS: "${REMOVE_OLD_MODS:-false}"
ports:

View File

@@ -10,7 +10,7 @@ services:
EULA: "true"
TYPE: "FORGE"
VERSION: "1.12.2"
FORGEVERSION: "14.23.5.2860"
FORGE_VERSION: "14.23.5.2860"
OVERRIDE_SERVER_PROPERTIES: "true"
DIFFICULTY: "hard"
MAX_TICK_TIME: "-1"

View File

@@ -14,8 +14,8 @@ services:
EULA: "TRUE"
#VERSION: "1.12.2" (Ensure this is compatbile with the version of SpongeForge you are using!)
TYPE: "FORGE"
FORGEVERSION: "RECOMMENDED"
#FORGEVERSION: "14.23.5.2807"
FORGE_VERSION: "RECOMMENDED"
#FORGE_VERSION: "14.23.5.2807"
CONSOLE: "false"
ENABLE_RCON: "true"
RCON_PASSWORD: "testing"

22
kustomize/README.md Normal file
View File

@@ -0,0 +1,22 @@
This directory provides a base to use with [kubectl kustomize](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/).
## Example overlay content
### kustomization.yml
```yaml
nameSuffix: "-forge"
commonLabels:
server: forge
bases:
- https://github.com/itzg/docker-minecraft-server.git/kustomize/base
configMapGenerator:
- name: mc
envs:
- mc.env
```
### mc.env
```
EULA=true
TYPE=FORGE
```

View File

@@ -0,0 +1,3 @@
resources:
- statefulset.yml
- service.yml

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: mc
annotations: {}
# Such as
# mc-router.itzg.me/externalServerName: $(EXTERNAL_SERVICE_NAME)
name: mc
spec:
ports:
- name: minecraft
port: 25565
targetPort: 25565
type: NodePort
selector:
server: mc

View File

@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mc
spec:
replicas: 1
serviceName: mc
selector:
matchLabels:
server: mc
template:
metadata:
labels:
server: mc
spec:
containers:
- name: mc
envFrom:
- configMapRef:
name: mc
optional: true
env: []
image: itzg/minecraft-server
stdin: true
tty: true
volumeMounts:
- mountPath: /data
name: data
resources:
requests:
cpu: 150m
livenessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 120
periodSeconds: 60
readinessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 12
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi

View File

@@ -16,9 +16,15 @@ IFS=$'\n\t'
: "${RCON_CMDS_LAST_DISCONNECT:=}"
: "${RCON_CMDS_PERIOD:=10}"
: "${RCON_PASSWORD_FILE:=}"
: "${ENABLE_RCON:=true}"
: "${RCON_PASSWORD:=minecraft}"
: "${RCON_PORT:=25575}"
export RCON_PASSWORD RCON_PORT
export ENABLE_RCON RCON_PASSWORD RCON_PORT
: "${MEMORY=1G}"
: "${INIT_MEMORY=${MEMORY}}"
: "${MAX_MEMORY=${MEMORY}}"
export MEMORY INIT_MEMORY MAX_MEMORY
shopt -s nullglob

View File

@@ -1,6 +1,7 @@
#!/bin/bash
: "${FORGEVERSION:=RECOMMENDED}"
: "${FORGE_VERSION:=${FORGEVERSION:-RECOMMENDED}}"
: "${FORGE_FORCE_REINSTALL:=false}}"
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
@@ -10,8 +11,8 @@ if ! mc-image-helper install-forge \
--output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VANILLA_VERSION}" \
--forge-version="${FORGEVERSION}" \
--force-reinstall="${FORCE_REINSTALL:-false}"; then
--forge-version="${FORGE_VERSION}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install forge"
exit 1
fi

View File

@@ -113,10 +113,6 @@ if [[ ${GUI,,} = false ]]; then
EXTRA_ARGS+=" nogui"
fi
: "${MEMORY=1G}"
: "${INIT_MEMORY=${MEMORY}}"
: "${MAX_MEMORY=${MEMORY}}"
expandedDOpts=
if [ -n "$JVM_DD_OPTS" ]; then
for dopt in $JVM_DD_OPTS

View File

@@ -224,6 +224,9 @@ function genericPacks() {
extract "${pack}" "${base_dir}"
done
# Remove any eula file since container manages it
rm -f "${base_dir}/eula.txt"
# recalculate the actual base directory of content
if ! base_dir=$(mc-image-helper find \
--max-depth=3 --type=directory --name=mods,plugins,config \
@@ -251,10 +254,14 @@ function genericPacks() {
cp -R -f "${base_dir}"/* /data
rm -rf $original_base_dir
log "Saving generic pack(s) checksum"
sha1sum "${packFiles[@]}" > "${sum_file}"
if isDebugging; then
cat "$sum_file"
if isTrue "${SKIP_GENERIC_PACK_CHECKSUM:-false}"; then
log "Skipping generic pack(s) checksum"
else
log "Saving generic pack(s) checksum"
sha1sum "${packFiles[@]}" > "${sum_file}"
if isDebugging; then
cat "$sum_file"
fi
fi
fi
fi

View File

@@ -4,7 +4,9 @@
. "${SCRIPTS:-/}start-utils"
: "${SERVER_PROPERTIES:=/data/server.properties}"
: "${ENABLE_RCON:=true}"
: "${OVERRIDE_SERVER_PROPERTIES:=true}"
: "${SKIP_SERVER_PROPERTIES:=false}"
: "${ENABLE_WHITELIST:=}"
# FUNCTIONS
function setServerPropValue {
@@ -39,33 +41,18 @@ function setServerProp {
}
function customizeServerProps {
local firstSetup=$1
# Whitelist processing
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST:-false}"; then
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST}"; then
log "Enabling whitelist functionality"
setServerPropValue "white-list" "true"
setServerPropValue "enforce-whitelist" "true"
else
elif isTrue "$firstSetup" || isFalse "${ENABLE_WHITELIST}"; then
log "Disabling whitelist functionality"
setServerPropValue "white-list" "false"
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
fi
# If not provided, generate a reasonable default message-of-the-day,
# which shows up in the server listing in the client
if ! [ -v MOTD ]; then
# snapshot is the odd case where we have to look at version to identify that label
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
label=SNAPSHOT
else
label=${ORIGINAL_TYPE}
fi
# Convert label to title-case
label=${label,,}
label=${label^}
MOTD="A ${label} Minecraft Server powered by Docker"
fi
# normalize MOTD
if [[ ${TYPE^^} = LIMBO ]]; then
if [[ $MOTD ]] && ! [[ $MOTD =~ ^{ ]]; then
@@ -121,7 +108,11 @@ function customizeServerProps {
setServerProp "simulation-distance" SIMULATION_DISTANCE
setServerProp "previews-chat" PREVIEWS_CHAT
setServerProp "enforce-secure-profile" ENFORCE_SECURE_PROFILE
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
setServerProp "initial-enabled-packs" INITIAL_ENABLED_PACKS
setServerProp "initial-disabled-packs" INITIAL_DISABLED_PACKS
if [[ $MOTD ]]; then
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
fi
[[ $LEVEL_TYPE ]] && setServerPropValue "level-type" "${LEVEL_TYPE^^}"
if [ -n "$DIFFICULTY" ]; then
@@ -208,22 +199,31 @@ if [[ ${TYPE} == "CURSEFORGE" ]]; then
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi
if ! isTrue "${SKIP_SERVER_PROPERTIES:-false}"; then
if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
if [ ! -e "$SERVER_PROPERTIES" ]; then
log "Creating server properties in ${SERVER_PROPERTIES}"
customizeServerProps
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
case ${OVERRIDE_SERVER_PROPERTIES^^} in
TRUE|1)
log "Updating server properties in ${SERVER_PROPERTIES}"
customizeServerProps
;;
*)
log "server.properties already created, skipping"
;;
esac
# If not provided, generate a reasonable default message-of-the-day,
# which shows up in the server listing in the client
if ! [ -v MOTD ]; then
# snapshot is the odd case where we have to look at version to identify that label
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
label=SNAPSHOT
else
label=${ORIGINAL_TYPE}
fi
# Convert label to title-case
label=${label,,}
label=${label^}
MOTD="A ${label} Minecraft Server powered by Docker"
fi
customizeServerProps true
elif isTrue "${OVERRIDE_SERVER_PROPERTIES}"; then
customizeServerProps false
else
log "server.properties already created, skipping"
log "server.properties already created and managed manually"
fi
else
log "Skipping setup of server.properties"

View File

@@ -58,7 +58,11 @@ getResourceFromSpiget() {
exit 2
fi
installedVersion=$(jq -r '.name' $versionfile)
if isTrue "${REMOVE_OLD_MODS:-false}"; then
installedVersion=0.0.0
else
installedVersion=$(jq -r '.name' $versionfile)
fi
newVersion=$(jq -r '.name' $versionfileNew)
if [ "$installedVersion" = "$newVersion" ]; then