-
Notifications
You must be signed in to change notification settings - Fork 251
feat: Add rootless Docker support #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Implements #547 - Add support for rootless Docker images to avoid permission issues. Key changes: - Add Dockerfile.rootless that runs as UID 1000 by default - Create simplified entrypoint script without chown operations - Add build-rootless.py to build rootless variants with -rootless suffix - Document rootless usage in README-ROOTLESS.md - Update main README with rootless section The rootless images eliminate common permission problems by: - Running as non-root from the start (USER 1000:1000) - Avoiding recursive chown operations that can cause race conditions - Using open permissions (777) on directories during build - Not supporting PUID/PGID environment variables This provides a cleaner solution for rootless Docker users and those experiencing permission issues with volumes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
@@ -0,0 +1,93 @@ | |||
# build rcon client | |||
FROM debian:stable-slim AS rcon-builder | |||
RUN apt-get -q update \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN chmod +x /*.sh | ||
|
||
# Set proper permissions for the factorio directory | ||
RUN chmod -R 777 /opt/factorio /factorio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
# Update mods if requested | ||
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then | ||
${INSTALLED_DIRECTORY}/docker-update-mods.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fi | ||
|
||
# Handle DLC | ||
${INSTALLED_DIRECTORY}/docker-dlc.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then | ||
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation" | ||
else | ||
if [[ ! -z "$PRESET" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
# Update mods if requested | ||
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then | ||
${INSTALLED_DIRECTORY}/docker-update-mods.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
${INSTALLED_DIRECTORY}/docker-update-mods.sh | |
"${INSTALLED_DIRECTORY}"/docker-update-mods.sh |
fi | ||
|
||
# Handle DLC | ||
${INSTALLED_DIRECTORY}/docker-dlc.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
${INSTALLED_DIRECTORY}/docker-dlc.sh | |
"${INSTALLED_DIRECTORY}"/docker-dlc.sh |
Summary
This PR implements rootless Docker support as requested in #547, providing a cleaner solution for users experiencing permission issues with Docker volumes.
What's Changed
New Rootless Images
Dockerfile.rootless
that runs as UID 1000 by defaultdocker-entrypoint-rootless.sh
without chown operationsbuild-rootless.py
to build rootless variants with-rootless
suffixstable-rootless
,latest-rootless
)Key Improvements
Documentation
README-ROOTLESS.md
with usage instructionsHow It Solves Permission Issues
The rootless images address the problems identified in #558:
Usage Example
Testing
Compatibility
build-rootless.py
Fixes #547
Related to #558
🤖 Generated with Claude Code