Skip to content

Security: Run container as non-root user (UID 10001)#235

Open
sbaerlocher wants to merge 1 commit into
LogicLabs-OU:mainfrom
sbaerlocher:security/non-root-container
Open

Security: Run container as non-root user (UID 10001)#235
sbaerlocher wants to merge 1 commit into
LogicLabs-OU:mainfrom
sbaerlocher:security/non-root-container

Conversation

@sbaerlocher
Copy link
Copy Markdown

Summary

Configure Docker container to run as non-root user app (UID 10001) instead of root.

Changes

  • Create non-root user with high UID (10001) in Dockerfile
  • Set proper ownership for application files and pnpm cache
  • Switch to non-root user before container starts

Benefits

  • Prevents host UID collisions
  • Reduces attack surface if container is compromised
  • Meets Kubernetes runAsNonRoot security policies
  • Follows Docker security best practices

Test

$ docker compose exec open-archiver id
uid=10001(app) gid=10001(app)

Security improvements to the Dockerfile:

- Create non-root user 'app' with high UID (10001)
- Set proper ownership for application files and pnpm cache
- Make entrypoint script executable
- Switch to non-root user before container starts

Benefits:
- Prevents host UID collisions with high UID
- Reduces attack surface if container is compromised
- Meets Kubernetes runAsNonRoot security policies
- Production-ready security best practices
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sbaerlocher
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant