Skip to content

Fix the uid conflict in Docker image by removing ubuntu user#384

Merged
pgleeson merged 1 commit intoopenworm:experimentalfrom
Ahiknsr:uid_conflict
Apr 21, 2026
Merged

Fix the uid conflict in Docker image by removing ubuntu user#384
pgleeson merged 1 commit intoopenworm:experimentalfrom
Ahiknsr:uid_conflict

Conversation

@Ahiknsr
Copy link
Copy Markdown

@Ahiknsr Ahiknsr commented Apr 14, 2026

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

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
@Ahiknsr Ahiknsr changed the title Fix the uid conflict by removing ubuntu user Fix the uid conflict in Docker image by removing ubuntu user Apr 14, 2026
Copy link
Copy Markdown

@weng271190436 weng271190436 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

@Ahiknsr
Copy link
Copy Markdown
Author

Ahiknsr commented Apr 15, 2026

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.

@weng271190436
Copy link
Copy Markdown

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

@pgleeson pgleeson changed the base branch from development to experimental April 21, 2026 09:14
@pgleeson
Copy link
Copy Markdown
Member

Thanks @Ahiknsr. Merging to experimental branch for testing.

@pgleeson pgleeson merged commit 1e8a647 into openworm:experimental Apr 21, 2026
3 checks passed
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.

3 participants