Repository navigation
Add support for setting a custom uid:gid - #7
Conversation
This could come in handy if your dev box or server doesn't have a user and group id of 1000:1000. Most folks won't need to adjust this.
61ed3c5 to
fd0781f
Compare
|
Going to YOLO this one. I tested it on 2 systems and Docker Desktop. |
|
Hey there! Quick review on this one What I realized is Now, the I don't know how one would go about fixing this, just tried giving a bit of informations with the lil amount of knowledge I have. Have a nice day! |
|
Hi, Thanks a lot for the extra insight. In your case did you have millions of users? Or is the issue here that I didn't encounter it because I once built that image with a UID of 1000 before I switched to a different 1002 user to build things? If Edit: I ended up opening an issue at nodejs/docker-node#1779. |
|
You're welcome! Having an UID of 1002 should cause no harm, the struct that holds the data is about 300 bytes. And since it's indexed based on UID, pam will seek to Great idea opening the issue! |
|
Ah, that makes full sense now. The hadolint warning came up in this project's pipeline when I pushed the change without it: https://github.com/nickjj/docker-flask-example/actions/runs/3124229750/jobs/5067392851#step:4:16 |
This will help folks who are running native Linux with a user/group that don't have a
uid:gidof1000:1000. This could be the case if they have multiple users on their system.If you're using Docker Desktop on Windows or macOS or are running native Linux where your
uid:gidis1000:1000then this won't affect you. Everything will work out of the box without having to customize anything.I tested it by creating a different user on my system that had a
uid:gidof1002:1003. I set those values in the.envfor both theUIDandGIDand things built successfully. I was also able to run everything without permission errors.Testing instructions:
Please comment in this PR that things worked successfully or post the error(s) if it didn't work.
I'm going to let this sit here until a few folks verify it works for them. I'm also going to use this time to see if there's a better way to do this. I don't really see too many other options. If anyone has any suggestions please let me know.