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

[NEXUS-14427] Usage of the UID via environment #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

khmarbaise
Copy link

Introduced the usage of an environment variable
for the user id to be used instead of hard coding
it.

This pull request makes the following changes:

  • NEXUS-14427

 o Introduced the usage of an environment variable
   for the user id to be used instead of hard coding
   it.
@jansohn
Copy link

jansohn commented Mar 29, 2019

+1. I want to be able to run the nexus container with a different UID to prevent confusion on the host server (UID 200 is already taken by another user on our servers...).

@woa7
Copy link

woa7 commented Dec 31, 2019

+1

@CMYanko
Copy link

CMYanko commented Dec 31, 2019

Since we moved to the UBI doesn’t it run as a random uid??

@jonashartwig
Copy link

Should this be a build arg instead? the user is created during image build cycle and if you use another id than 200 in docker run it should not work.

@FibreFoX
Copy link

FibreFoX commented May 6, 2020

@jonashartwig I'm against having this being a build arg, makes it impossible to just change it for different container-instances.

@jonashartwig
Copy link

Hi, it can be build arg and env. However, i fail to understand how this would work. docker build . -t nexus then docker run -d -p 8081:8081 --env USERID=$(id -u) nexus where id -u returns 300. How will this work?

@FibreFoX
Copy link

FibreFoX commented May 6, 2020

Oh stupid me :) you are right @jonashartwig, no idea why this slipped my mind ... the user gets added at build-time. Maybe this should be changed too? Like "once per container"? The problem I see is this being hardcoded, so I would be forced to create my own Dockerfile to override this. Not sure which solution would be better: build-time or execution-time?! But whatever solution get's picked, it is better than current state where this is hard-coded.

@skandragon
Copy link

Openshift (Kubernetes like system) assigns a random UID / GID. The trick is to make a lot of world writable directories, and not assume you can get any homedirs or passwd entries that make sense.

@northbear
Copy link

Actually it's not bid deal to update the Dockerfile with sed. But at least making uid/gid to be higher than 1000 (2000 for example) would make a life significantly easier.

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.

8 participants