Skip to content

Fix build error due to conflicting uid:gid #28

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Cyberbeni
Copy link

Fixes #27
I found out that VSCode supports working through an SSH connection so I could try out dev containers on my desktopless Linux server from my Windows machine.
I got the same error as in codespaces described in the issue.
I haven't tried this fix in codespaces but I don't see why it shouldn't work.

Added all the explanation in a comment, so if people decide that they want to change the name of their user inside the devcontainer, they will see the comment and will be able make an educated decision whether they really want to change it or not.

@Cyberbeni
Copy link
Author

It also might be better to use containerUser instead of remoteUser?

https://containers.dev/implementors/json_reference/

@adam-fowler
Copy link
Member

It also might be better to use containerUser instead of remoteUser?

https://containers.dev/implementors/json_reference/

I used remoteUser as that is what the other container templates were using.

@Cyberbeni
Copy link
Author

I haven't found any example where a process is run as the containerUser instead of the remoteUser but since we don't need anything run as root, I think it's safer to override containerUser.

@adam-fowler
Copy link
Member

While all the Microsoft authored containers still use "remoteUser": "vscode" I'd like to use that.

@Cyberbeni
Copy link
Author

They delete the ubuntu user in their base image, so uid:gid doesn't conflict between that and the vscode user:
https://github.com/devcontainers/images/blob/466aac5d06c87841d257cac96dd876afb9b7a578/src/base-ubuntu/.devcontainer/Dockerfile#L7-L13

@Cyberbeni
Copy link
Author

Cyberbeni commented Oct 9, 2024

Based on the link in my previous comment, earlier Ubuntu base images didn't create the ubuntu user?

This should probably work. I haven't tested it with older Swift versions as I found out that using a dev container for Swift on Linux is just more complicated than having Swift installed locally, so I will just stick to that.

Since the uid:gid will get updated due to updateRemoteUserUID defaulting to true, I think it is better to leave those options out.
https://github.com/devcontainers/features/blob/d23166286d8123410be6c41144669dcd8e4c8eea/src/common-utils/main.sh#L421-L431

edit: others also ran into this issue: https://askubuntu.com/questions/1513927/ubuntu-24-04-docker-images-now-includes-user-ubuntu-with-uid-gid-1000

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.

Fails to build in GitHub Codespaces
2 participants