Compare commits
7 Commits
e057c808a8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| bed8684352 | |||
| 58e34860fd | |||
| 8d2c901978 | |||
| 07c8bfd165 | |||
| 30802403cc | |||
| bdbcebf366 | |||
| e48fa26b5a |
13
Dockerfile
13
Dockerfile
@@ -3,6 +3,11 @@ ARG MINECRAFT_VERSION="1.16.5"
|
|||||||
ARG FORGE_VERSION="36.2.26"
|
ARG FORGE_VERSION="36.2.26"
|
||||||
ARG JRE_VERSION="openjdk8-jre"
|
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
|
# The first stage just builds up the modpack
|
||||||
FROM alpine:latest AS build
|
FROM alpine:latest AS build
|
||||||
|
|
||||||
@@ -26,10 +31,18 @@ FROM alpine:latest AS final
|
|||||||
|
|
||||||
# Use only a subset of arguments
|
# Use only a subset of arguments
|
||||||
ARG JRE_VERSION
|
ARG JRE_VERSION
|
||||||
|
ARG UID
|
||||||
|
ARG USER
|
||||||
|
ARG GID
|
||||||
|
ARG GROUP
|
||||||
|
|
||||||
# Build the thing up
|
# Build the thing up
|
||||||
RUN apk add bash curl findutils rsync screen "${JRE_VERSION}"
|
RUN apk add bash curl findutils rsync screen "${JRE_VERSION}"
|
||||||
WORKDIR /minecraft
|
WORKDIR /minecraft
|
||||||
COPY --from=build /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" ]
|
CMD [ "bash", "start-server.sh" ]
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if [ -n "$FORGE_PACK_ZIP" ]; then
|
|||||||
echo "Found modpack directory: $directory"
|
echo "Found modpack directory: $directory"
|
||||||
fi
|
fi
|
||||||
echo "Syncing content to /minecraft"
|
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
|
popd > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user