Closed Wanchen7 closed 7 years ago
Problem here is that your primary group id collides with an existing system group id in the container.
Your user setup on your host is unusual, most Linux systems expert user ids > 1000 for users and 500-999 for system accounts. Same for group ids. See /etc/login.defs
Why is your group ID so low?
I'm using the MBP with macOS 10.12. The UID start from 501 by default. I'm trying to change UID to 1001,seemed that create a brand new user, all the applications must be reinstall. So I drop this incredible way to build android source code. Thanks for answer my questions.
Well, running directly on macOS would likely lead to alot of headaches with the performance of hte volume mounting through the VM. I used to build Android on macOS in a Docker container (via Linux VM) a few years ago, and wouldn't recommend it.
Can this problem be solved ?
Use root user will solve it
How do you use root user? What commands do you run to set it? Thanks.
use root user to run command.
This seems random. Sometimes it works and sometimes it still throws the error. So the command is: sudo AOSP_VOL=$PWD/build bash ./build-marshmallow.sh
And most of the time it still throws: docker_entrypoint: Creating /tmp/ccache and /aosp directory chown: changing ownership of '/tmp/ccache': Operation not permitted chown: changing ownership of '/aosp': Operation not permitted
I was able to work around this issue.
This gets it going on OSX
You can also just change the $AOSP_HOST_ID_ARGS
in https://github.com/kylemanna/docker-aosp/blob/dd9995aae650fff7129c3720e56cf1f7b9b0430b/utils/aosp#L53 to both be zero (0
) and fix the ownership of the build directory afterwards with something like,
sudo chown -R $uid:$(id -g) build/
slightly less risky than doing a sudo docker ...
command
ocker_entrypoint: Creating user UID/GID [501/20] groupadd: GID '20' already exists docker_entrypoint: Creating user UID/GID [501/20] - done docker_entrypoint: Copying .gitconfig and .ssh/config to new user home cp: cannot create regular file '/home/aosp/.gitconfig': No such file or directory docker_entrypoint: Creating /tmp/ccache and /aosp directory chown: invalid user: 'aosp:aosp'