8 Commits

Author SHA1 Message Date
bed8684352 Actually wait let's reorder those args 2022-06-14 14:33:13 -05:00
58e34860fd Actually make /minecraft writeable 2022-06-14 14:32:15 -05:00
8d2c901978 Fix invocation of addgroup and adduser
Hopefully really this time
2022-06-14 14:20:21 -05:00
07c8bfd165 Quote variables, actually scope in our arguments 2022-06-14 14:16:51 -05:00
30802403cc Use busyboxisms for creating a user/group 2022-06-14 14:14:21 -05:00
bdbcebf366 Ignore permissions on rsync 2022-06-14 14:10:39 -05:00
e48fa26b5a Try adding a user to the container 2022-06-14 14:10:19 -05:00
e057c808a8 Remove the JDK version and Forge version from our tags because we don't care about them
They're static for each version
2022-06-14 13:59:11 -05:00
3 changed files with 15 additions and 2 deletions

View File

@@ -3,6 +3,11 @@ ARG MINECRAFT_VERSION="1.16.5"
ARG FORGE_VERSION="36.2.26"
ARG JRE_VERSION="openjdk8-jre"
ARG UID=1520
ARG USER=minecraft
ARG GID=1520
ARG GROUP=minecraft
# The first stage just builds up the modpack
FROM alpine:latest AS build
@@ -26,10 +31,18 @@ FROM alpine:latest AS final
# Use only a subset of arguments
ARG JRE_VERSION
ARG UID
ARG USER
ARG GID
ARG GROUP
# Build the thing up
RUN apk add bash curl findutils rsync screen "${JRE_VERSION}"
WORKDIR /minecraft
COPY --from=build /minecraft .
RUN addgroup -g "${GID}" "${GROUP}" && \
adduser -h /minecraft -s /bin/sh -D -H -u "${UID}" -G "${GROUP}" "${USER}" && \
chown "${USER}:${GROUP}" /minecraft
USER $USER
CMD [ "bash", "start-server.sh" ]
EXPOSE 25565

View File

@@ -32,7 +32,7 @@ for mc in ${mcversions[@]}; do
jre="${jreversions[$mc]}"
CI_HUB_USERNAME="${CI_HUB_USERNAME:=rehashedsalt}"
CI_PROJECT_NAME="${CI_PROJECT_NAME:=minecraft-forge}"
tag="$CI_HUB_USERNAME/$CI_PROJECT_NAME:$mc-$forge-$jre-${CI_COMMIT_REF_NAME:=bleeding}"
tag="$CI_HUB_USERNAME/$CI_PROJECT_NAME:$mc-${CI_COMMIT_REF_NAME:=bleeding}"
echo "Building image..."
echo " Minecraft: $mc"
echo " Forge: $forge"

View File

@@ -22,7 +22,7 @@ if [ -n "$FORGE_PACK_ZIP" ]; then
echo "Found modpack directory: $directory"
fi
echo "Syncing content to /minecraft"
rsync --ignore-existing "$directory"/ /minecraft/
rsync --no-perms --no-owner --no-group --ignore-existing "$directory"/ /minecraft/
popd > /dev/null 2>&1
fi