Compare commits

..

36 Commits

Author SHA1 Message Date
Geoff Bourne
cbf9577a24 Auto-merging via docker-versions-create 2021-04-11 10:11:28 -05:00
Geoff Bourne
9ccfca5061 Merged latest from master 2021-04-08 19:24:14 -05:00
Geoff Bourne
9690832247 Auto-merging via docker-versions-create 2021-04-01 16:39:46 -05:00
Geoff Bourne
60a68963a8 Added git
#819
2021-04-01 16:28:50 -05:00
Geoff Bourne
6ae431b2f0 Merge branch 'master' into java15 2021-03-06 16:25:21 -06:00
Geoff Bourne
ebabfeb669 Shifted PATH-fix earlier in startup 2021-03-06 16:05:01 -06:00
Geoff Bourne
457e9b53c7 Auto-merging via docker-versions-create 2021-02-27 20:55:30 -06:00
Geoff Bourne
21572d3547 Ensure FTBA version.json is readable
#784
2021-02-27 17:03:37 -06:00
Geoff Bourne
b176be942d Fix PATH to include java when needed 2021-02-10 14:52:16 -06:00
Geoff Bourne
51c5902db0 Merge from master
CONFLICT (content): Merge conflict in start-configuration
2021-02-10 14:06:10 -06:00
Geoff Bourne
090e624ebc Auto-merging via docker-versions-create
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 18:20:35 -06:00
Geoff Bourne
c8dc751b82 Auto-merging docker-versions-create.sh
CONFLICT (content): Merge conflict in Dockerfile
2021-02-07 09:15:01 -06:00
Geoff Bourne
7c862df92a Merge branch 'master' into java15 2021-02-06 15:12:45 -06:00
Geoff Bourne
e49c1c2f01 Merge branch 'master' into java15 2021-02-06 15:11:34 -06:00
Geoff Bourne
57390b02ca Merge branch 'master' into java15 2021-02-06 14:53:02 -06:00
Geoff Bourne
a698248dff ci: Based on adoptopenjdk:15-jre 2021-02-06 14:50:43 -06:00
Geoff Bourne
b8ef6eba3f Auto-merging via docker-versions-create 2021-01-29 21:07:29 -06:00
Geoff Bourne
cc5fe0859a Auto-merging via docker-versions-create 2021-01-12 17:28:33 -06:00
Geoff Bourne
8f15aac6fc Merge branch 'multiarch' into multiarch-latest 2021-01-12 17:06:00 -06:00
Geoff Bourne
84ce3b4b47 Merge branch 'multiarch' into multiarch-latest 2021-01-09 14:07:31 -06:00
Geoff Bourne
b07c43a32f Merge branch 'multiarch' into multiarch-latest 2021-01-09 12:31:20 -06:00
Geoff Bourne
ce1b337f7f Auto-merging via docker-versions-create 2021-01-09 11:25:38 -06:00
Geoff Bourne
ee8e1b9322 Merged latest from master 2021-01-06 22:16:40 -06:00
Geoff Bourne
20bd5c4c36 Merge branch 'multiarch' into multiarch-latest 2020-12-31 13:19:34 -06:00
Geoff Bourne
de082d0fb2 Merge branch 'multiarch' into multiarch-latest 2020-12-28 11:44:41 -06:00
Geoff Bourne
3cc5cdbc06 Auto-merging via docker-versions-create 2020-12-27 22:08:29 -06:00
Geoff Bourne
b69ec47b18 Auto-merging via docker-versions-create 2020-12-19 08:26:49 -06:00
Geoff Bourne
51fc8e824d Auto-merging via docker-versions-create 2020-12-15 14:00:33 -06:00
Geoff Bourne
aff9031284 Merge branch 'multiarch' into multiarch-latest 2020-11-26 08:46:26 -06:00
Geoff Bourne
397d080da2 Merge branch 'multiarch' into multiarch-latest 2020-11-25 21:36:48 -06:00
Geoff Bourne
cb5d052829 Merge branch 'multiarch' into multiarch-latest
# Conflicts:
#	.github/workflows/build-multiarch.yml
2020-11-25 16:09:23 -06:00
Geoff Bourne
0908d21bed Merged from master 2020-11-25 16:01:42 -06:00
Marc Doughty
4d878985d4 Remove distro-provided JRE (#659)
We don't need Java 8 from Ubuntu, we have 15 from AdoptOpenJDK.
2020-11-03 06:33:19 -06:00
Geoff Bourne
72d7d4a65e Switched to latest Docker buildx github action 2020-10-31 14:48:51 -05:00
Geoff Bourne
cb0add3b90 Added github action match for multiarch-latest branch 2020-10-31 13:38:44 -05:00
Marc Doughty
71a48ce10f Convert to AdoptOpenJDK (#658) 2020-10-31 13:36:47 -05:00
14 changed files with 68 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
FROM adoptopenjdk:8-jre-hotspot FROM adoptopenjdk:15-jre
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>" LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"

View File

@@ -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 `/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. 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.
> 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,20 +527,24 @@ up:
docker stop mc docker stop mc
docker start mc docker start mc
## Optional plugins, mods, and config attach points ### Using separate mounts
There are optional volume paths that can be attached to supply content to be copied into the data area: This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option.
`/plugins` There are two additional volumes that can be mounted; `/mods` and `/config`.
: 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`. Any files in either of these filesystems will be copied over to the main
`/data` filesystem before starting Minecraft.
`/mods` This works well if you want to have a common set of modules in a separate
: contents are copied into `/data/mods` for Forge related server types location, but still have multiple worlds with different server requirements
in either persistent volumes or a downloadable archive.
`/config` ## Deploying plugins from attached volume
: contents are copied into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`
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. 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`.
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

View File

@@ -98,6 +98,12 @@ case "${TYPE^^}" in
;; ;;
FORGE) FORGE)
log "**********************************************************************"
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
log " since some mods require Java 8"
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
log " can be fixed with java8"
log "**********************************************************************"
exec ${SCRIPTS:-/}start-deployForge "$@" exec ${SCRIPTS:-/}start-deployForge "$@"
;; ;;
@@ -109,7 +115,13 @@ case "${TYPE^^}" in
exec ${SCRIPTS:-/}start-deployFTBA "$@" exec ${SCRIPTS:-/}start-deployFTBA "$@"
;; ;;
CURSEFORGE|FTB) FTB|CURSEFORGE)
log "**********************************************************************"
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
log " since some mods require Java 8"
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
log " can be fixed with java8"
log "**********************************************************************"
exec ${SCRIPTS:-/}start-deployCF "$@" exec ${SCRIPTS:-/}start-deployCF "$@"
;; ;;

View File

@@ -33,4 +33,5 @@ fi
export TYPE=SPIGOT export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" # Continue to Final Setup
exec ${SCRIPTS:-/}start-finalSetupWorld $@

View File

@@ -60,8 +60,8 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
mkdir -p ${FTB_BASE_DIR} mkdir -p ${FTB_BASE_DIR}
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar") serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "$SERVER" ]]; then if [[ -z "$serverJar" ]]; then
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
loadForgeVars "${FTB_BASE_DIR}/settings.cfg" loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
@@ -89,15 +89,14 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
fi fi
echo "${FTB_SERVER_MOD}" > $installMarker echo "${FTB_SERVER_MOD}" > $installMarker
SERVER=$(find ${FTB_BASE_DIR} -type f -not -name "forge*installer.jar" -name "forge*.jar")
fi fi
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
log "ERROR unable to locate installed forge server jar" log "ERROR unable to locate installed forge server jar"
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar" isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
exit 2 exit 2
fi fi
export SERVER
export FTB_DIR=$(dirname "${SERVER}") export FTB_DIR=$(dirname "${SERVER}")
@@ -168,16 +167,6 @@ 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

View File

@@ -34,4 +34,5 @@ fi
export TYPE=SPIGOT export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-spiget "$@" # Continue to Final Setup
exec ${SCRIPTS:-/}start-finalSetupWorld $@

View File

@@ -23,4 +23,5 @@ fi
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export TYPE=SPIGOT export TYPE=SPIGOT
exec ${SCRIPTS:-/}start-spiget "$@" # Continue to Final Setup
exec ${SCRIPTS:-/}start-finalSetupWorld $@

View File

@@ -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 "*.hjson" -or -name "*.json" \) \ -or -name "*.conf" -or -name "*.properties" \) \
$fileExcludes \ $fileExcludes \
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \; -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
done done

View File

@@ -11,9 +11,21 @@ fi
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects} CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
# Remove old mods/plugins # Remove old mods/plugins
if isTrue ${REMOVE_OLD_MODS:-false}; then if isTrue ${REMOVE_OLD_MODS}; then
removeOldMods /data/mods remove_mods_dest="/data/mods"
removeOldMods /data/plugins case ${TYPE} in
SPIGOT|BUKKIT|PAPER)
remove_mods_dest="/data/plugins"
;;
esac
# only try to remove existing mods dir
if [ -d "$remove_mods_dest" ]; then
log "Removing old mods in $remove_mods_dest..."
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
else
log "Directory $remove_mods_dest does not exist; removing nothing."
fi
fi fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack # If supplied with a URL for a modpack (simple zip of jars), download it and unpack
@@ -25,12 +37,12 @@ if [[ "$MODPACK" ]]; then
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK) downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
if ! [[ $downloadUrl == *.zip ]]; then if ! [[ $downloadUrl == *.zip ]]; then
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK" log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
log " Must be HTTP, HTTPS or FTP and a ZIP file" log " Must be HTTP or HTTPS and a ZIP file"
exit 1 exit 1
fi fi
fi fi
log "Downloading mod/plugin pack" log "Downloading mod/plugin pack via HTTP"
log " from $downloadUrl ..." log " from $downloadUrl ..."
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
log "ERROR: failed to download from $downloadUrl" log "ERROR: failed to download from $downloadUrl"

View File

@@ -21,12 +21,10 @@ 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 $COPY_MODS_DEST mkdir -p /data/mods
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ $COPY_MODS_DEST rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
fi fi
: ${COPY_CONFIG_DEST:="/data/config"} : ${COPY_CONFIG_DEST:="/data/config"}

View File

@@ -181,8 +181,8 @@ function customizeServerProps {
} }
# Deploy server.properties file # Deploy server.properties file
if [[ ${TYPE} == "CURSEFORGE" ]]; then if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
export SERVER_PROPERTIES="${FTB_DIR}/server.properties" export SERVER_PROPERTIES=${FTB_DIR}/server.properties
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}" log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi fi
@@ -214,7 +214,7 @@ fi
if isDebugging; then if isDebugging; then
log "DEBUG Dumping server.properties" log "DEBUG Dumping server.properties"
cat "${SERVER_PROPERTIES}" cat /data/server.properties
fi fi
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@ exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@

View File

@@ -7,7 +7,7 @@ isDebugging && set -x
: ${LEVEL:=world} : ${LEVEL:=world}
export LEVEL export LEVEL
if [ $TYPE = "CURSEFORGE" ]; then if [ $TYPE = "FEED-THE-BEAST" ]; then
worldDest=$FTB_DIR/$LEVEL worldDest=$FTB_DIR/$LEVEL
else else
worldDest=/data/$LEVEL worldDest=/data/$LEVEL

View File

@@ -16,7 +16,7 @@ containsJars() {
if [[ $line =~ $pat ]]; then if [[ $line =~ $pat ]]; then
return 0 return 0
fi fi
done <<<$(unzip -l "$file") done <<< $(unzip -l "$file")
return 1 return 1
} }
@@ -46,14 +46,10 @@ getResourceFromSpiget() {
} }
if [[ ${SPIGET_RESOURCES} ]]; then if [[ ${SPIGET_RESOURCES} ]]; then
if isTrue ${REMOVE_OLD_MODS:-false}; then
removeOldMods /data/plugins
REMOVE_OLD_MODS=false
fi
log "Getting plugins via Spiget" log "Getting plugins via Spiget"
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}" IFS=',' read -r -a resources <<< "${SPIGET_RESOURCES}"
for resource in "${resources[@]}"; do for resource in "${resources[@]}"
do
getResourceFromSpiget "${resource}" getResourceFromSpiget "${resource}"
done done
fi fi

View File

@@ -11,7 +11,7 @@ function join_by() {
function isURL() { function isURL() {
local value=$1 local value=$1
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
return 0 return 0
else else
return 1 return 1
@@ -174,9 +174,3 @@ eula=${EULA,,}
exit 2 exit 2
fi fi
} }
function removeOldMods {
if [ -d "$1" ]; then
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
fi
}