Skip to content
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

Add environment variable to run the commandbox container under a specific user id #64

Closed
netcom-severs opened this issue Nov 8, 2021 · 3 comments

Comments

@netcom-severs
Copy link

Add the option to pass an environment variable to run the container under an specific user id.
Currently there is only the option to pass an username via "USER", but you can not control the uid of the user.

Therefore you can not align the ownership of files from the host-system and the container without building you own image.

netcom-severs added a commit to netcom-severs/docker-commandbox that referenced this issue Nov 8, 2021
@JoshTickles
Copy link

Just to let you know, as a work around / solution you can simply add the user to your image with the id you want. We do this in production where some of our containers need to access NFS shares, and this works perfectly for that.

RUN useradd -m -u 1001 -g 33 myuser
ENV USER myuser

@netcom-severs
Copy link
Author

Yeah, thats right.
But that works only on build-time.

As we run dozens of containers with different user ids, that does not work out for us.

jclausen added a commit that referenced this issue Oct 18, 2022
@jclausen
Copy link
Collaborator

I have added support for this in the latest snapshot and I have also added a default of any runtime user to 1001 unless the USER_ID environment variable is specified. I've got a few other features to wrap up and then I will be publishing a release. Once that's done, this will be present in image versions >= 3.6.1

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

No branches or pull requests

3 participants