mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-05-13 23:45:25 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
@@ -132,7 +132,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Enabling Autopause](#enabling-autopause)
|
* [Enabling Autopause](#enabling-autopause)
|
||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Fri Oct 22 21:06:58 UTC 2021 -->
|
<!-- Added by: runner, at: Mon Oct 25 01:23:52 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -223,6 +223,8 @@ services:
|
|||||||
- ./minecraft-data:/data
|
- ./minecraft-data:/data
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> NOTE: if you have SELinux enabled, then you might need to add `:Z` to the end of volume mount specifications, [as described here](https://prefetch.net/blog/2017/09/30/using-docker-volumes-on-selinux-enabled-servers/).
|
||||||
|
|
||||||
### Converting anonymous `/data` volume to named volume
|
### Converting anonymous `/data` volume to named volume
|
||||||
|
|
||||||
If you had used the commands in the first section, without the `-v` volume attachment, then an anonymous data volume was created by Docker. You can later bring over that content to a named or host attached volume using the following procedure.
|
If you had used the commands in the first section, without the `-v` volume attachment, then an anonymous data volume was created by Docker. You can later bring over that content to a named or host attached volume using the following procedure.
|
||||||
@@ -719,6 +721,8 @@ You may also download or copy over individual mods using the `MODS` environment
|
|||||||
|
|
||||||
To install all of the server content (jars, mods, plugins, configs, etc) from a zip file, such as a CurseForge modpack that is missing a server start script, then set `GENERIC_PACK` to the container path of the zip file. That, combined with `TYPE`, allows for custom content along with container managed server download and install.
|
To install all of the server content (jars, mods, plugins, configs, etc) from a zip file, such as a CurseForge modpack that is missing a server start script, then set `GENERIC_PACK` to the container path of the zip file. That, combined with `TYPE`, allows for custom content along with container managed server download and install.
|
||||||
|
|
||||||
|
If multiple generic packs need to be applied together, set `GENERIC_PACKS` instead, with a comma separated list of zip file paths and/or URLs to zip files.
|
||||||
|
|
||||||
### Mod/Plugin URL Listing File
|
### Mod/Plugin URL Listing File
|
||||||
|
|
||||||
As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following
|
As an alternative to `MODS`, the variable `MODS_FILE` can be set with the path to a text file listing a mod/plugin URL on each line. For example, the following
|
||||||
|
|||||||
+27
-14
@@ -8,7 +8,7 @@ set -e -o pipefail
|
|||||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
|
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
# shellcheck source=start-utils
|
||||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
. "${SCRIPTS:-/}start-utils"
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
# CURSE_URL_BASE used in manifest downloads below
|
# CURSE_URL_BASE used in manifest downloads below
|
||||||
@@ -158,28 +158,40 @@ case "X$EFFECTIVE_MANIFEST_FILE" in
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${GENERIC_PACK}" ]]; then
|
: "${GENERIC_PACKS:=${GENERIC_PACK}}"
|
||||||
if isURL "${GENERIC_PACK}"; then
|
|
||||||
log "Downloading generic pack ..."
|
if [[ "${GENERIC_PACKS}" ]]; then
|
||||||
if ! curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"; then
|
IFS=',' read -ra packs <<< "${GENERIC_PACKS}"
|
||||||
log "ERROR: failed to download ${GENERIC_PACK}"
|
|
||||||
exit 2
|
packFiles=()
|
||||||
|
for pack in "${packs[@]}"; do
|
||||||
|
if isURL "$pack"; then
|
||||||
|
mkdir -p /data/packs
|
||||||
|
if ! outfile=$(get -o /data/packs --output-filename --skip-existing "$pack"); then
|
||||||
|
log "ERROR: failed to download $pack"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
packFiles+=("$outfile")
|
||||||
|
else
|
||||||
|
packFiles+=("$pack")
|
||||||
fi
|
fi
|
||||||
GENERIC_PACK=/tmp/generic_pack.zip
|
done
|
||||||
fi
|
|
||||||
|
|
||||||
sum_file=/data/.generic_pack.sum
|
sum_file=/data/.generic_pack.sum
|
||||||
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
||||||
if ! sha256sum -c "${sum_file}" --status 2> /dev/null; then
|
if ! sha256sum -c "${sum_file}" --status 2> /dev/null; then
|
||||||
base_dir=/tmp/generic_pack_base
|
base_dir=/tmp/generic_pack_base
|
||||||
mkdir -p ${base_dir}
|
mkdir -p ${base_dir}
|
||||||
isDebugging && ls -l "${GENERIC_PACK}"
|
for pack in "${packFiles[@]}"; do
|
||||||
unzip -q -d ${base_dir} "${GENERIC_PACK}"
|
isDebugging && ls -l "${pack}"
|
||||||
|
unzip -q -d ${base_dir} "${pack}"
|
||||||
|
done
|
||||||
|
|
||||||
# recalculate the actual base directory of content
|
# recalculate the actual base directory of content
|
||||||
base_dir=$(find "$base_dir" -type d \( -name mods -o -name plugins -o -name config \) -printf '%h' -quit)
|
base_dir=$(find "$base_dir" -type d \( -name mods -o -name plugins -o -name config \) -printf '%h' -quit)
|
||||||
if [[ ! $base_dir ]]; then
|
if [[ ! $base_dir ]]; then
|
||||||
log "Unable to find content base of generic pack ${GENERIC_PACK}"
|
log "ERROR: Unable to find content base of generic packs ${GENERIC_PACKS}. Directories:"
|
||||||
|
find /tmp/generic_pack_base -type d -printf ' - %P\n'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -199,9 +211,10 @@ if [[ "${GENERIC_PACK}" ]]; then
|
|||||||
log "Applying generic pack ..."
|
log "Applying generic pack ..."
|
||||||
cp -R -f "${base_dir}"/* /data
|
cp -R -f "${base_dir}"/* /data
|
||||||
rm -rf /tmp/generic_pack_base
|
rm -rf /tmp/generic_pack_base
|
||||||
sha256sum "${GENERIC_PACK}" > "${sum_file}"
|
|
||||||
|
sha256sum "${packFiles[@]}" > "${sum_file}"
|
||||||
isDebugging && cat "$sum_file"
|
isDebugging && cat "$sum_file"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "${SCRIPTS:-$(dirname "$0")}/start-setupModconfig" "$@"
|
exec "${SCRIPTS:-/}start-setupModconfig" "$@"
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
environment:
|
||||||
|
EULA: "true"
|
||||||
|
GENERIC_PACKS: https://github.com/itzg/mc-image-helper/releases/download/v1.9.5/mc-image-helper-1.9.5.zip,/packs/testing.zip
|
||||||
|
DEBUG: "true"
|
||||||
|
volumes:
|
||||||
|
- ./packs:/packs
|
||||||
|
- data:/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data: {}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user