docker-minecraft/build.sh
Salt 2e03a1faf8 Update Forge for 1.16
I uh... hope this fixes the log4j issue
2021-12-20 12:26:22 -06:00

32 lines
764 B
Bash
Executable File

#! /bin/bash
#
# Build the Docker image for a series of different Forge versions
#
# MC version list
declare -a mcversions=(
"1.16.5"
)
# Forge version dictionary (we only support one version per)
declare -A forgeversions=(
["1.16.5"]="36.2.22"
)
# Build images
docker buildx create --use
for mc in ${mcversions[@]}; do
forge="${forgeversions[$mc]}"
echo "Building image for Minecraft $mc, Forge $forge, CI_COMMIT_REF_NAME of $CI_COMMIT_REF_NAME"
# --no-cache is required for clean builds
docker buildx build \
--build-arg MINECRAFT_VERSION="$mc" \
--build-arg FORGE_VERSION="$forge" \
--no-cache \
--platform linux/amd64 \
--tag "$CI_HUB_USERNAME/$CI_PROJECT_NAME:$mc-$forge-${CI_COMMIT_REF_NAME:=bleeding}" \
--push \
.
done
docker images