File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ ENV MEM_SIZE="1G"
1313
1414COPY --chmod=755 ./install-gosu.sh ./install-paper.sh ./docker-entrypoint.sh /usr/local/bin/
1515
16- RUN yum install -y shadow-utils jq && \
17- useradd -r -u ${PUID} mc && \
16+ RUN yum install -y jq && \
17+ echo "mc:x:${PUID}:${PUID}::/opt/minecraft:/sbin/nologin" >> /etc/passwd && \
18+ echo "mc:x:${PUID}:" >> /etc/group && \
1819 mkdir -p /opt/minecraft/data && \
1920 install-gosu.sh && \
2021 install-paper.sh
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -e
33
4- if [ -n " ${PUID} " ] && [ ! " ${PUID} " = " $( id mc -u) " ]; then
5- usermod -o -u " $PUID " mc
6- echo " UID of mc user: $( id mc -u) "
4+ if [ -n " ${PUID} " ] && [ ! " ${PUID} " = " $( id -u mc) " ]; then
5+ echo " UID: $( id -u mc) -> ${PUID} "
6+ sed -i -E " s/^mc:([^:]*):[0-9]+:[0-9]+:/mc:\1:${PUID} :${PUID} :/" /etc/passwd
7+ sed -i -E " s/^mc:([^:]*):[0-9]+:/mc:\1:${PUID} :/" /etc/group
78fi
89
910chown -R mc /opt/minecraft
You can’t perform that action at this time.
0 commit comments