Use busyboxisms for creating a user/group

This commit is contained in:
Salt 2022-06-14 14:14:21 -05:00
parent bdbcebf366
commit 30802403cc
1 changed files with 4 additions and 2 deletions

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
@ -33,7 +34,8 @@ ARG JRE_VERSION
# 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
RUN addgroup -g $GID $USER && \
adduser -h /minecraft -s /bin/sh -G $GROUP -D -H -u $UID
WORKDIR /minecraft
COPY --from=build /minecraft .
USER $USER