mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2026-03-09 07:25:57 -05:00
[PR #989] [MERGED] Add userdef #1001
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/veggiemonk/awesome-docker/pull/989
Author: @theAkito
Created: 4/1/2022
Status: ✅ Merged
Merged: 4/4/2022
Merged by: @agebhar1
Base:
master← Head:master📝 Commits (3)
6ebeafeAdd userdefa5d8cf9Fix Developer Reference6aa8d46Fix Developer Reference📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
README.md(+3 -1)📄 Description
What
userdefdoesThis tool is a more advanced
adduser/useraddfor your Alpine and BusyBox based Docker images.For example, this tool may create a custom OS user with a custom ID inside pre-made Docker images, which perhaps already have a custom user defined and rebuilding the Docker image just to have your custom user in it is not an option.
https://github.com/theAkito/userdef#what
Why
userdefexistsReason 1
Now, more and more server apps try to go with the current meta of being available on Kubernetes, etc. This is a good idea, however it's often not well executed.
Almost all of the popular server apps are not cloud-native. Their structure is still of some legacy kind.
Examples are Mattermost, Gitea, Nextcloud.
These server apps have Helm Charts available. However, applying best practices, especially the ones regarding security are not easy to achieve.
Especially, when talking about the
podSecurityContext. ThefsGroupoption is either not respected properly, which leads to broken deployments, or it's not even available and you have to add it yourself to the Helm Chart.For example, take the Gitea Helm Chart as an example. You are allowed to set the
podSecurityContext:d94226765d/values.yaml (L19-L20)But, if you provide your custom
fsGroupvalue, then the deployment will be broken. Why?66f2210fec/Dockerfile.rootless (L39-L48)Because the user and group ID of
1000is hard-coded into the Docker image.Now, imagine you have an
sshfsmount, which requires you using the user of the ID9234.The hard-coded
1000inside the image breaks usage of thissshfsmount, just because it does not let you define a custom user with a custom ID.To make all this work more smoothly, this tool aims to delete the existing user in that Docker image and then recreate it with your custom user, which has an ID defined by you, instead of being forced to use the randomly chosen hard-coded user ID.
Reason 2
You may just as well use this tool as a better
adduserwhere the actualadduseroruseradd(like the one in Alpine) have arbitrary and unnecessary restrictions, like for example limiting the UID/GID size to 256000.https://github.com/theAkito/userdef#why
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.