Improve Image

This commit is contained in:
TheBrokenRail 2021-02-10 20:03:19 -05:00
parent 4de452517a
commit 6ab07f04db
2 changed files with 21 additions and 16 deletions

View File

@ -3,6 +3,8 @@ services:
minecraft-pi-server: minecraft-pi-server:
image: 'thebrokenrail/minecraft-pi-reborn:server' image: 'thebrokenrail/minecraft-pi-reborn:server'
network_mode: 'host' network_mode: 'host'
stdin_open: true
tty: true
volumes: volumes:
- /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static - /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static
- '${MCPI_ROOT}:/home/.minecraft-pi' - '${MCPI_ROOT}:/home/.minecraft-pi'

View File

@ -8,24 +8,27 @@ if [ ! "$(id -u)" = '0' ]; then
exit 1 exit 1
fi fi
# Create User Groups # Check
if [ -z "${USER_GID+x}" ]; then if ! id user > /dev/null 2>&1; then
USER_GID='1000' # Create User Groups
fi if [ -z "${USER_GID+x}" ]; then
groupadd --force --gid "${USER_GID}" user USER_GID='1000'
fi
groupadd --force --gid "${USER_GID}" user
# Create User # Create User
if [ -z "${USER_UID+x}" ]; then if [ -z "${USER_UID+x}" ]; then
USER_UID='1000' USER_UID='1000'
fi fi
useradd --shell /bin/sh --home-dir /home --no-create-home --uid "${USER_UID}" --gid "${USER_GID}" user useradd --shell /bin/sh --home-dir /home --no-create-home --uid "${USER_UID}" --gid "${USER_GID}" user
# Add Other Groups # Add Other Groups
if [ ! -z "${USER_OTHER_GIDS+x}" ]; then if [ ! -z "${USER_OTHER_GIDS+x}" ]; then
for gid in ${USER_OTHER_GIDS}; do for gid in ${USER_OTHER_GIDS}; do
groupadd --force --gid "${gid}" "group-${gid}" groupadd --force --gid "${gid}" "group-${gid}"
usermod -aG "${gid}" user usermod -aG "${gid}" user
done done
fi
fi fi
# Start # Start