Update Dockerfile for Ubuntu 24.04#2744
Update Dockerfile for Ubuntu 24.04#2744alnI3S wants to merge 2 commits intoGenesis-Embodied-AI:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49b77aceba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if [ -n "$EXISTING_USER" ] && [ "$EXISTING_USER" != "$USER_NAME" ]; then | ||
| echo "UID $TARGET_UID already belongs to $EXISTING_USER — removing it" | ||
| userdel "$EXISTING_USER" || true |
There was a problem hiding this comment.
Handle undeletable UID conflicts before calling usermod
detectUIDConflict suppresses userdel failures with || true, but the script then unconditionally runs usermod -u "$LOCAL_USER_ID" user. If LOCAL_USER_ID belongs to a protected or otherwise undeletable account (e.g., UID 0/root), userdel fails silently, usermod fails because the UID is still taken, and set -e terminates container startup. This makes launches fail for those host/CI UID mappings instead of falling back or emitting a clear controlled error.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
As I wrote in my comment, there are 2 solutions: create another username or delete the default user username. I select the former solution for convenient, so removing set -e solves the issue?
Description
Related Issue
Since Ubuntu 24.04
pip installis no longer supported. One has to create a python virtual environment and activate it or uses the flag--break-system-packagesless safer.Ubuntu 24.04 has default
user. To fix that one has to delete the defaultuserand re-create it or using another username.Motivation and Context
For using newer Ubuntu and Python
How Has This Been / Can This Be Tested?
In Genesis root folder, build the docker image with
docker build -t genesis:testing -f docker/Dockerfile docker/or pull it from my docker hubdocker pull i3salng/genesis:latestcreate a source file
genesis_wswith this content:source <path/to/genesis_ws>hello_genesis.py:python examples/tutorials/hello_genesis.py