redroid-doc icon indicating copy to clipboard operation
redroid-doc copied to clipboard

Error to "docker build" Redroid11 with MindtheGapps arm64

Open titusbiao opened this issue 1 year ago • 1 comments

Hello,

I am now running a Debian 12.4 server ("git", "git-lfs", "repo" and "docker" are installed), and following the "https://github.com/remote-android/redroid-doc/blob/master/android-builder-docker/README.md" to build with Redroid 11 with MindtheGapps (revision "rho", arm64).

Everything goes fine except the "docker build" line.

the README.md file says:

#####################
# create builder
#####################
docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) -t redroid-builder .

However, while I copy this command and it comes out with errors:

root@VM-0-8-debian:~/redroid# docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) -t redroid-builder .
[+] Building 104.7s (6/6) FINISHED                                                                                                                                                                                                                   docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                           0.0s
 => => transferring dockerfile: 1.42kB                                                                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                                                1.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                0.0s
 => [1/3] FROM docker.io/library/ubuntu:20.04@sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9c35d                                                                                                                                          2.8s
 => => resolve docker.io/library/ubuntu:20.04@sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9c35d                                                                                                                                          0.0s
 => => sha256:3cff1c6ff37e0101a08119d0743ba95c7f505d00298f5a169129e4e9086cde9e 2.29kB / 2.29kB                                                                                                                                                                 0.0s
 => => sha256:17d0386c2fff30a5b92652bbef2b84639dba9b9f17bdbb819c8d10badd827fdb 27.51MB / 27.51MB                                                                                                                                                               1.6s
 => => sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9c35d 1.13kB / 1.13kB                                                                                                                                                                 0.0s
 => => sha256:48c35f3de33487442af224ed4aabac19fd9bfbd91ee90e9471d412706b20ba73 424B / 424B                                                                                                                                                                     0.0s
 => => extracting sha256:17d0386c2fff30a5b92652bbef2b84639dba9b9f17bdbb819c8d10badd827fdb                                                                                                                                                                      1.0s
 => [2/3] RUN apt-get update     && echo "install package for building AOSP"     && apt-get install -y git-core gnupg flex bison build-essential zip curl zlib1g-dev         gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11prot  100.5s
 => ERROR [3/3] RUN groupadd -g 0 root     && useradd -m -u 0 -g 0 root     && echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers     && echo root >/root/username     && echo "root:root" | chpasswd && adduser root sudo                                    0.4s
------                                                                                                                                                                                                                                                              
 > [3/3] RUN groupadd -g 0 root     && useradd -m -u 0 -g 0 root     && echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers     && echo root >/root/username     && echo "root:root" | chpasswd && adduser root sudo:                                               
0.226 groupadd: group 'root' already exists                                                                                                                                                                                                                         
------                                                                                                                                                                                                                                                              
Dockerfile:27                                                                                                                                                                                                                                                       
--------------------
  26 |     
  27 | >>> RUN groupadd -g $groupid $username \
  28 | >>>     && useradd -m -u $userid -g $groupid $username \
  29 | >>>     && echo "$username ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
  30 | >>>     && echo $username >/root/username \
  31 | >>>     && echo "$username:$username" | chpasswd && adduser $username sudo
  32 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c groupadd -g $groupid $username     && useradd -m -u $userid -g $groupid $username     && echo \"$username ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers     && echo $username >/root/username     && echo \"$username:$username\" | chpasswd && adduser $username sudo" did not complete successfully: exit code: 9

redroid

Any solution to this?

titusbiao avatar Apr 15 '24 08:04 titusbiao

0.226 groupadd: group 'root' already exists

I assume running as normal user instead of root (which is bad practice). Try adjust the user related operations if insist use the root user.

zhouziyang avatar Apr 15 '24 10:04 zhouziyang