arnaupv / nvim-devcontainer-cli

MIT License
62 stars 0 forks source link

Invalid user and group #21

Closed erichlf closed 2 months ago

erichlf commented 2 months ago

It appears that it is assumed that the devcontainer user and group is my-app:my-app, which is not valid in my container.

Mon Apr  8 19:48:25 UTC 2024 - Creation of config folders:
Mon Apr  8 19:48:25 UTC 2024 - Folder /home/my-app/.config created.
chown: invalid user: ‘my-app:my-app’

I haven't quite looked into why this is happening, but I figured I would report the main blocker for me right now with using this plugin.

EDIT: I can see that the home directory was hard coded as HOME_IN_DOCKER_CONTAINER="/home/my-app/".

EDIT2: The only other reference to my-app that I found is in the .devcontainer for this repo. So for some reason it appears that DevcontainerUp is trying to bring up the wrong container?

arnaupv commented 2 months ago

yeah, great points, devcontainer recommends the user of a non-root user here https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user

so it would be great to enforce the creation of non-root user even though the creation of this user should be managed completely by current plugin and the devcontainer cli. I've started working on that but I have not finished yet. https://github.com/arnaupv/nvim-devcontainer-cli/tree/stop-forcing-the-use-of-my-app-as-a-container-user

arnaupv commented 2 months ago

Looks like what you are proposing solves the issue, thanks! ❤️