Fix the uid conflict in Docker image by removing ubuntu user#384
Fix the uid conflict in Docker image by removing ubuntu user#384pgleeson merged 1 commit intoopenworm:experimentalfrom
Conversation
Ubuntu 24.04 docker images now includes user ubuntu with UID/GID 1000[1], in the dockerfile we are adding user ow with the same uid. This is causing issue when trying to use the dockerfile with devcontainers and it doesn't make any sense to have two different users with same uid so removing the ubuntu user using the instructions from ubuntu bug report[2] for this change. also adding user using useradd instead of manually changing bunch of files and installing sudo package so we don't have to create /etc/sudoers.d manually [1] https://askubuntu.com/questions/1513927/ubuntu-24-04-docker-images-now-includes-user-ubuntu-with-uid-gid-1000 [2] https://bugs.launchpad.net/cloud-images/+bug/2005129/comments/2
There was a problem hiding this comment.
"This is causing issue when trying to use the dockerfile with devcontainers"
Curious what issue did you see with dev containers?
I tried using dev containers before the fix and after the fix, both seem to work. Though the "before fix" container is not clean because it is showing ubuntu as the user. As ubuntu, I am still the owner of files that are supposed to be owned by ow (probably because I am considered the same user as ow anyway because of the same UID).
ubuntu@ec1692b8b33f:~$ whoami
ubuntu
ubuntu@ec1692b8b33f:~$ stat master_openworm.py
File: master_openworm.py
Size: 11513 Blocks: 24 IO Block: 4096 regular file
Device: 0,62 Inode: 317601 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ ubuntu) Gid: ( 1000/ ubuntu)
Access: 2026-04-15 12:19:56.115510012 +0000
Modify: 2026-04-06 01:23:59.944992091 +0000
Change: 2026-04-15 12:19:55.310510012 +0000
Birth: 2026-04-15 12:19:55.309510012 +0000
ubuntu@ec1692b8b33f:~$ pwd
/home/ow
ubuntu@ec1692b8b33f:~$
Not a maintainer so my vote doesn't count but think this is a good cleanup.
|
are you able to escalate privileges to root using sudo as ubuntu user? So we are building sibernetic as root and that was causing some permission issue when i try to run sibernetic manually (as ubuntu user) without using master_openworm.py file. |
|
It is true that ubuntu can't sudo. ow can because of NOPASSWD:ALL I wonder if people have just been doing this to directly run the container as root docker run --rm -it --user 0 openworm-test bash |
|
Thanks @Ahiknsr. Merging to experimental branch for testing. |
Ubuntu 24.04 docker images now includes user ubuntu with UID/GID 1000[1], in the dockerfile we are adding user ow with the same uid. This is causing issue when trying to use the dockerfile with devcontainers and it doesn't make any sense to have two different users with same uid so removing the ubuntu user using the instructions from ubuntu bug report[2] for this change.
also adding user using useradd instead of manually changing bunch of files and installing sudo package so we don't have to create /etc/sudoers.d manually
[1] https://askubuntu.com/questions/1513927/ubuntu-24-04-docker-images-now-includes-user-ubuntu-with-uid-gid-1000
[2] https://bugs.launchpad.net/cloud-images/+bug/2005129/comments/2