docker-commandbox
docker-commandbox copied to clipboard
Add environment variable to run the commandbox container under a specific user id
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.
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
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.
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