Deadolus / android-studio-docker

Android Studio + flutter in Docker. Emulator works too - with or without Display, even over SSH if you forward the display
Apache License 2.0
138 stars 56 forks source link

Error running on an Intel Mac #7

Open abulka opened 2 years ago

abulka commented 2 years ago

On an Intel Mac, I get an error on the line RUN chown android:android /androidstudio-data:. The error is chown: cannot access '/androidstudio-data': No such file or directory. But surely the volume exists due to the VOLUME line preceding the RUN line?

VOLUME /androidstudio-data
RUN chown $USER:$USER /androidstudio-data

Here is the full output:

$ ./build.sh 
[+] Building 416.0s (17/31)                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                0.1s
 => => transferring dockerfile: 1.95kB                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                   0.1s
 => => transferring context: 52B                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.04                                                                     5.8s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                       0.0s
 => [internal] load build context                                                                                                   0.1s
 => => transferring context: 3.34kB                                                                                                 0.0s
 => [ 1/26] FROM docker.io/library/ubuntu:18.04@sha256:982d72c16416b09ffd2f71aa381f761422085eda1379dc66b668653607969e38             7.1s
 => => resolve docker.io/library/ubuntu:18.04@sha256:982d72c16416b09ffd2f71aa381f761422085eda1379dc66b668653607969e38               0.0s
 => => sha256:f5cbed4244ba3f663e03aaa70f5a4cd0f1c03ad186c3560b639488e84d9f027d 1.46kB / 1.46kB                                      0.0s
 => => sha256:08a6abff89437fab99b52abbefed82ea907f12845c30eeb94f6b93c69be93166 26.71MB / 26.71MB                                    4.3s
 => => sha256:982d72c16416b09ffd2f71aa381f761422085eda1379dc66b668653607969e38 1.41kB / 1.41kB                                      0.0s
 => => sha256:512274f1739676880585e70eea6a883db7b6d92841b02647b6c92b478356572c 529B / 529B                                          0.0s
 => => extracting sha256:08a6abff89437fab99b52abbefed82ea907f12845c30eeb94f6b93c69be93166                                           2.2s
 => [ 2/26] RUN dpkg --add-architecture i386                                                                                        0.7s
 => [ 3/26] RUN apt-get update && apt-get install -y         build-essential git neovim wget unzip sudo         libc6:i386 libnc  398.2s
 => [ 4/26] RUN groupadd -g 1000 -r android                                                                                         0.5s
 => [ 5/26] RUN useradd -u 1000 -g 1000 --create-home -r android                                                                    0.5s 
 => [ 6/26] RUN adduser android libvirt                                                                                             0.5s 
 => [ 7/26] RUN adduser android kvm                                                                                                 0.5s 
 => [ 8/26] RUN echo "android:android" | chpasswd                                                                                   0.4s 
 => [ 9/26] RUN echo "android ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-android                                                   0.3s 
 => [10/26] RUN usermod -aG sudo android                                                                                            0.4s
 => [11/26] RUN usermod -aG plugdev android                                                                                         0.4s
 => ERROR [12/26] RUN chown android:android /androidstudio-data                                                                     0.3s
------
 > [12/26] RUN chown android:android /androidstudio-data:
#16 0.306 chown: cannot access '/androidstudio-data': No such file or directory
------
executor failed running [/bin/sh -c chown $USER:$USER /androidstudio-data]: exit code: 1

Does anyone have any clues?

rouzwelt commented 2 years ago

hey, thanks for this, didnt want to open a new issue, but wanted to know if it works on cloud VMs or shared vCPU VPS?

HeraclitoDeEfeso commented 2 years ago

I'm having the same problem:

$ ./build.sh
[+] Building 3.5s (16/33)
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 2.25kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 52B                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.04                                                    3.0s
 => [internal] load build context                                                                                  0.0s
 => => transferring context: 3.34kB                                                                                0.0s
 => [ 1/29] FROM docker.io/library/ubuntu:18.04@sha256:ca70a834041dd1bf16cc38dfcd24f0888ec4fa431e09f3344f354cf8d1  0.0s
 => CACHED [ 2/29] RUN dpkg --add-architecture i386                                                                0.0s
 => CACHED [ 3/29] RUN apt-get update && apt-get install -y         build-essential git neovim wget unzip sudo     0.0s
 => CACHED [ 4/29] RUN groupadd -g 1000 -r android                                                                 0.0s
 => CACHED [ 5/29] RUN useradd -u 1000 -g 1000 --create-home -r android                                            0.0s
 => CACHED [ 6/29] RUN adduser android libvirt                                                                     0.0s
 => CACHED [ 7/29] RUN adduser android kvm                                                                         0.0s
 => CACHED [ 8/29] RUN echo "android:android" | chpasswd                                                           0.0s
 => CACHED [ 9/29] RUN echo "android ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-android                           0.0s
 => CACHED [10/29] RUN usermod -aG sudo android                                                                    0.0s
 => CACHED [11/29] RUN usermod -aG plugdev android                                                                 0.0s
 => ERROR [12/29] RUN chown android:android /androidstudio-data                                                    0.4s
------
 > [12/29] RUN chown android:android /androidstudio-data:
#15 0.432 chown: cannot access '/androidstudio-data': No such file or directory
------
executor failed running [/bin/sh -c chown $USER:$USER /androidstudio-data]: exit code: 1

This is from Ubuntu image under WSL2

gycold commented 1 year ago

i think just because of that it use VOLUME command,so just shield this two lines in dockerfile: VOLUME /androidstudio-data RUN chown $USER:$USER /androidstudio-data

or,change androidstudio-data to studio-data,just same as the dirname in the same path......