DeviceFarmer / stf

Control and manage Android devices from your browser.
https://devicefarmer.github.io
Other
3.51k stars 496 forks source link

Error while building docker image: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 #763

Closed khda closed 7 months ago

khda commented 7 months ago

I'm trying to build an image based on a Dockerfile from the root of the repository. I get the error: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2. In theory, my OS is not important, but I use MasOS.

Docker version 25.0.3, build 4debf41.

Latest repository commit: git log -1 commit b5b3f910ca87d67c86372e442eb5787398987505 (HEAD -> master, origin/master, origin/HEAD) Author: Karol Wrótniak karol.wrotniak@droidsonroids.pl Date: Sat Mar 23 17:26:40 2024 +0100 Add version 3.6.7 to CHANGELOG

Reproduction steps: git clone git@github.com:DeviceFarmer/stf.git cd stf docker build . -f Dockerfile

Error text: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2

Full output:

[+] Building 39.3s (7/10)                                                                          docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 2.70kB                                                                             0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                    1.5s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 182B                                                                                  0.0s
 => [1/6] FROM docker.io/library/ubuntu:20.04@sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9  0.0s
 => [internal] load build context                                                                                  0.0s
 => => transferring context: 72.78kB                                                                               0.0s
 => CACHED [2/6] WORKDIR /app                                                                                      0.0s
 => ERROR [3/6] RUN export DEBIAN_FRONTEND=noninteractive &&     useradd --system       --create-home       --sh  37.7s
------                                                                                                                  
 > [3/6] RUN export DEBIAN_FRONTEND=noninteractive &&     useradd --system       --create-home       --shell /usr/sbin/nologin       stf-build &&     useradd --system       --create-home       --shell /usr/sbin/nologin       stf &&     sed -i'' 's@http://archive.ubuntu.com/ubuntu/@mirror://mirrors.ubuntu.com/mirrors.txt@' /etc/apt/sources.list &&     apt-get update &&     apt-get -y install wget python3 build-essential &&     cd /tmp &&     wget --progress=dot:mega       https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-x64.tar.xz &&     tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local &&     rm node-v*.tar.xz &&     su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' &&     apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick openjdk-8-jdk yasm cmake &&     apt-get clean &&     rm -rf /var/cache/apt/* /var/lib/apt/lists/* &&     mkdir /tmp/bundletool &&     cd /tmp/bundletool &&     wget --progress=dot:mega       https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar &&     mv bundletool-all-1.2.0.jar bundletool.jar:
0.503 Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
0.619 Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
0.718 Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
0.839 Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
...
33.94 Setting up libalgorithm-merge-perl (0.08-3) ...
33.94 Setting up libldap-2.4-2:arm64 (2.4.49+dfsg-2ubuntu1.10) ...
33.94 Setting up dirmngr (2.2.19-3ubuntu2.2) ...
33.99 Setting up gpg-wks-client (2.2.19-3ubuntu2.2) ...
33.99 Setting up gnupg (2.2.19-3ubuntu2.2) ...
33.99 Processing triggers for libc-bin (2.31-0ubuntu9.14) ...
34.00 Processing triggers for ca-certificates (20230311ubuntu0.20.04.1) ...
34.00 Updating certificates in /etc/ssl/certs...
34.13 0 added, 0 removed; done.
34.13 Running hooks in /etc/ca-certificates/update.d...
34.13 done.
34.14 --2024-04-01 08:32:34--  https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-x64.tar.xz
34.14 Resolving nodejs.org (nodejs.org)... 104.20.23.46, 104.20.22.46, 2606:4700:10::6814:162e, ...
34.14 Connecting to nodejs.org (nodejs.org)|104.20.23.46|:443... connected.
34.26 HTTP request sent, awaiting response... 200 OK
34.29 Length: 22659144 (22M) [application/x-xz]
34.29 Saving to: 'node-v17.9.0-linux-x64.tar.xz'
34.31 
34.31      0K ........ ........ ........ ........ ........ ........ 13% 10.8M 2s
34.58   3072K ........ ........ ........ ........ ........ ........ 27% 11.2M 1s
34.85   6144K ........ ........ ........ ........ ........ ........ 41% 11.2M 1s
35.12   9216K ........ ........ ........ ........ ........ ........ 55% 11.2M 1s
35.38  12288K ........ ........ ........ ........ ........ ........ 69% 11.2M 1s
35.65  15360K ........ ........ ........ ........ ........ ........ 83% 11.2M 0s
35.92  18432K ........ ........ ........ ........ ........ ........ 97% 11.2M 0s
36.19  21504K ........ .                                           100% 11.5M=1.9s
36.24 
36.24 2024-04-01 08:32:36 (11.1 MB/s) - 'node-v17.9.0-linux-x64.tar.xz' saved [22659144/22659144]
36.24 
37.47 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
37.47  Trace/breakpoint trap
------
Dockerfile:21
--------------------
  20 |     # wait for them on the first native module installation.
  21 | >>> RUN export DEBIAN_FRONTEND=noninteractive && \
  22 | >>>     useradd --system \
  23 | >>>       --create-home \
  24 | >>>       --shell /usr/sbin/nologin \
  25 | >>>       stf-build && \
  26 | >>>     useradd --system \
  27 | >>>       --create-home \
  28 | >>>       --shell /usr/sbin/nologin \
  29 | >>>       stf && \
  30 | >>>     sed -i'' 's@http://archive.ubuntu.com/ubuntu/@mirror://mirrors.ubuntu.com/mirrors.txt@' /etc/apt/sources.list && \
  31 | >>>     apt-get update && \
  32 | >>>     apt-get -y install wget python3 build-essential && \
  33 | >>>     cd /tmp && \
  34 | >>>     wget --progress=dot:mega \
  35 | >>>       https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-x64.tar.xz && \
  36 | >>>     tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local && \
  37 | >>>     rm node-v*.tar.xz && \
  38 | >>>     su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' && \
  39 | >>>     apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick openjdk-8-jdk yasm cmake && \
  40 | >>>     apt-get clean && \
  41 | >>>     rm -rf /var/cache/apt/* /var/lib/apt/lists/* && \
  42 | >>>     mkdir /tmp/bundletool && \
  43 | >>>     cd /tmp/bundletool && \
  44 | >>>     wget --progress=dot:mega \
  45 | >>>       https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar && \
  46 | >>>     mv bundletool-all-1.2.0.jar bundletool.jar
  47 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c export DEBIAN_FRONTEND=noninteractive &&     useradd --system       --create-home       --shell /usr/sbin/nologin       stf-build &&     useradd --system       --create-home       --shell /usr/sbin/nologin       stf &&     sed -i'' 's@http://archive.ubuntu.com/ubuntu/@mirror://mirrors.ubuntu.com/mirrors.txt@' /etc/apt/sources.list &&     apt-get update &&     apt-get -y install wget python3 build-essential &&     cd /tmp &&     wget --progress=dot:mega       https://nodejs.org/dist/v17.9.0/node-v17.9.0-linux-x64.tar.xz &&     tar -xJf node-v*.tar.xz --strip-components 1 -C /usr/local &&     rm node-v*.tar.xz &&     su stf-build -s /bin/bash -c '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js install' &&     apt-get -y install libzmq3-dev libprotobuf-dev git graphicsmagick openjdk-8-jdk yasm cmake &&     apt-get clean &&     rm -rf /var/cache/apt/* /var/lib/apt/lists/* &&     mkdir /tmp/bundletool &&     cd /tmp/bundletool &&     wget --progress=dot:mega       https://github.com/google/bundletool/releases/download/1.2.0/bundletool-all-1.2.0.jar &&     mv bundletool-all-1.2.0.jar bundletool.jar" did not complete successfully: exit code: 133

What could be the problem?

Maybe what other data is needed?

denis99999 commented 7 months ago

@khda , try Dockerfile-debian-x86_64

khda commented 7 months ago

@denis99999 Yeah, now I saw more dockerfiles. Unfortunately, the build based on Dockerfile-debian-x86_64 ended with the same error for me. However, Dockerfile-debian-arm64 and Dockerfile-debian-armhf worked for me. I think that's enough for me