-
Notifications
You must be signed in to change notification settings - Fork 1
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
UID Issue on MacOS #102
Comments
Thank you for the report! I'm guessing this is indeed a bug that I originally ran into when attempting to test on MacOS #71 which I gave up on since develop-by-CI is an arduous process. Since I do not have access to MacOS, I will need to ask you to report the outputs of some commands. 1. Check File OwnershipSo the UID/GID isn't setup in the container, but does the mapping work for files being written from in the container?
2. Full Running CommandBefore I dive into googling about docker on MacOS, I'd like to make sure the flags are what I expect. Please run
and post the result. This will be very long since the environment variable deduction is included, but I only need the last few lines (the 3. User Info on MacOSI now realize that MacOS does not use the /etc/passwd file like on Linux. This might mean a more difficult refactor of denv to support user mapping on MacOS as well as Linux (bare or WSL). I have yet to find a good run-time solution online. |
1:
2:
|
Thank you, can you post the output of the following command?
|
I'm... guessing this isn't what you expected?
|
Yep, forgot that I had that check in there, try
|
uid=0(root) gid=0(root) groups=0(root) |
cool, that's what I hoped, time to look at distrobox's code and see how they create the user in their entrypoint |
Actually,
ID in container
Can you give these a try? |
Nope, still getting root :( |
shoot, I was really excited for a moment there |
Can you try out distrobox? I just want to make sure it is resolving this issue before I delve into its source code.
|
Distrobox isn't available on macs. Podman is if that helps? |
Thank you for finding that issue, I always assumed it was. That makes me feel better about struggling with this. I would like to try a very manual solution that I wanted to avoid since it could increase start-up time, but here we go. The basic idea is to create the user while you are root in the container and then become that user for the rest of the container's lifetime. I'm looking at these lines of distrobox: https://github.com/89luca89/distrobox/blob/867f4f85c762bc74bf398c8654984b801138e154/distrobox-init#L2009C1-L2030C7 which would then be followed by
where |
The more I look into this, the more I believe this is due to a fundamental limitation on how the Linux VMs are spawned on MacOS. With this in mind, I wrote a OS section on the website to give more detail to future users about what type of functionality they can expect. |
Describe the bug
Attempting to use any tool that checks /etc/passwd for user IDs seems to not work on Mac devices. Examples include
git
or justwhoami
.To Reproduce
Steps to reproduce the behavior:
denv
with...whoami
You also see your username in the prompt as I have no name
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add output of
denv version
anddenv config print
here.denv v0.5.0
denv_workspace="/Users/einarelen/ldmx/umpg/ldmx-sw/SimCore/G4Py8"
denv_name="G4Py8"
denv_image="ldmx/local:91-pythia8-support-dev-mt-debug"
denv_mounts=""
denv_shell="/bin/bash -i"
Docker version 24.0.6, build ed223bc
The text was updated successfully, but these errors were encountered: