Skip to content

Commit

Permalink
Add SKIP_CHOWN_DATA to skip the "Changing ownership of /data" (#3103)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Oct 13, 2024
1 parent f5da624 commit afbdfea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/misc/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ To troubleshoot the container initialization, such as when server files are pre-
To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`.

To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`.

If you are experiencing any issues with the "Changing ownership of /data" step, that can be disabled by setting `SKIP_CHOWN_DATA` to `true`.
3 changes: 2 additions & 1 deletion scripts/start
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# The Dockerfile ENVs take precedence here, but defaulting for testing consistency
: "${UID:=1000}"
: "${GID:=1000}"
: "${SKIP_CHOWN_DATA:=false}"

umask "${UMASK:=0002}"

Expand Down Expand Up @@ -38,7 +39,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
fi
fi

if [[ $(stat -c "%u" /data) != "$UID" ]]; then
if isTrue "${SKIP_CHOWN_DATA}" || [[ $(stat -c "%u" /data) != "$UID" ]]; then
log "Changing ownership of /data to $UID ..."
chown -R ${runAsUser}:${runAsGroup} /data
fi
Expand Down

0 comments on commit afbdfea

Please sign in to comment.