5 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

View File

@@ -4,8 +4,9 @@ ARG FORGE_VERSION="36.2.26"
ARG JRE_VERSION="openjdk8-jre"
ARG UID=1520
ARG GID=1520
ARG USER=minecraft
ARG GID=1520
ARG GROUP=minecraft
# The first stage just builds up the modpack
FROM alpine:latest AS build
@@ -30,12 +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}"
RUN groupadd -g $GID -o $USER && useradd -m -u $UID -g $GID -o -s /bin/bash $USER
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