Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Raspberry Pi 4 - Ubuntu 19.10 - aarch64 #14

Open
jbiancot opened this issue Mar 30, 2020 · 3 comments
Open

Build fails on Raspberry Pi 4 - Ubuntu 19.10 - aarch64 #14

jbiancot opened this issue Mar 30, 2020 · 3 comments

Comments

@jbiancot
Copy link

jbiancot commented Mar 30, 2020

Hi there... I am trying to build this but I am getting an error, I have no idea.

Please advice, thanks in advance.

[root@pi4 ~/docker-compose-aarch64-1.25.4]  docker build . -t docker-compose-aarch64-builder
Sending build context to Docker daemon  4.881MB
Step 1/16 : FROM arm64v8/python:3.7.7-stretch
3.7.7-stretch: Pulling from arm64v8/python
668c278237ef: Pull complete 
8b41cac09012: Pull complete 
094b35393827: Pull complete 
95fba2538bf9: Pull complete 
6e1c9497c36a: Pull complete 
a74f16752538: Pull complete 
6f44aa925681: Pull complete 
5ba35f89967f: Pull complete 
85d06a3370cf: Pull complete 
Digest: sha256:6cf8ebe03f8b86f7e5acf9abc74563bcfe122f33daa87ba4e64588f37d6d75ab
Status: Downloaded newer image for arm64v8/python:3.7.7-stretch
 ---> 5c374f780c14
Step 2/16 : ENV LANG C.UTF-8
 ---> Running in 2c65d8c14415
Removing intermediate container 2c65d8c14415
 ---> d934376883bf
Step 3/16 : COPY ./vendor/qemu-bin /usr/bin/
 ---> 5fab3866f592
Step 4/16 : RUN [ "cross-build-start" ]
 ---> Running in 3e388da7c03d
standard_init_linux.go:211: exec user process caused "exec format error"
The command 'cross-build-start' returned a non-zero code: 1

--------------------------------------------------------------------

[root@pi4 ~/docker-compose-aarch64-1.25.4]  docker --version
Docker version 19.03.8, build afacb8b


[root@pi4 ~/docker-compose-aarch64-1.25.4]  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan


[root@pi4 ~/docker-compose-aarch64-1.25.4]  uname -a
Linux pi4 5.3.0-1019-raspi2 #21-Ubuntu SMP Mon Feb 17 14:05:03 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

@hmahadik
Copy link

@jbiancot I had the same issue on an Nvidia Jetson Xavier NX so I tried building on x86_64, then copying the resulting binary to the aarch64 target. Seems to work.

$ docker build . -t docker-compose-aarch64-builder
Sending build context to Docker daemon  6.928MB
Step 1/15 : FROM arm64v8/python:3.6.5-stretch
3.6.5-stretch: Pulling from arm64v8/python
6054c6775a4e: Pull complete 
0d57f1ab872b: Pull complete 
662e63f6b578: Pull complete 
242c1552cb59: Pull complete 
b998f5fde260: Pull complete 
e6e5ed806665: Pull complete 
078b324593ba: Pull complete 
b1c7a51750e4: Pull complete 
f2afed663dbe: Pull complete 
Digest: sha256:3a651864bc098090db216127d6ff31c766b95f13b70f3a690ba53b1039f806bd
Status: Downloaded newer image for arm64v8/python:3.6.5-stretch
 ---> ec24596c3d76
Step 2/15 : ENV LANG C.UTF-8
 ---> Running in 57ebd4745488
Removing intermediate container 57ebd4745488
 ---> ceb13330bc0e
Step 3/15 : COPY ./vendor/qemu-bin /usr/bin/
 ---> 81d9936bf01b
Step 4/15 : RUN [ "cross-build-start" ]
 ---> Running in 04dd3be6733b
Removing intermediate container 04dd3be6733b
 ---> 271d3fcdfe11
Step 5/15 : ENV DOCKER_COMPOSE_VER 1.22.0
 ---> Running in 6d92c8d05890
Removing intermediate container 6d92c8d05890
 ---> ad3d4f91058d
Step 6/15 : ENV PYINSTALLER_VER 3.3.1
 ---> Running in 617e60ca941b
Removing intermediate container 617e60ca941b
 ---> 2d31f440022c
Step 7/15 : ENV SIX_VER 1.11.0
 ---> Running in 1108bd522697
Removing intermediate container 1108bd522697
 ---> fc5a1b1fc307
Step 8/15 : RUN pip install six==$SIX_VER
 ---> Running in 878a2285cf13
Collecting six==1.11.0
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six
Successfully installed six-1.11.0
You are using pip version 10.0.1, however version 20.2b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Removing intermediate container 878a2285cf13
 ---> 3d2b7924c604
Step 9/15 : WORKDIR /build/pyinstallerbootloader
 ---> Running in 472d8957f102
Removing intermediate container 472d8957f102
 ---> b4f7a7604c1f
Step 10/15 : RUN curl -fsSL https://github.com/pyinstaller/pyinstaller/releases/download/v$PYINSTALLER_VER/PyInstaller-$PYINSTALLER_VER.tar.gz | tar xvz >/dev/null     && cd PyInstaller*/bootloader     && python3 ./waf all
 ---> Running in 86ce24cc0397
'all' finished successfully (0.009s)
'distclean' finished successfully (0.002s)
Setting top to                           : /build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader 
Setting out to                           : /build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking size of pointer                 : 8 
Platform                                 : Linux-64bit detected based on compiler 
Checking for program '/usr/bin/strip'    : /usr/bin/strip 
Checking for program 'strip'             : /usr/bin/strip 
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library z                   : yes 
Checking for function unsetenv           : yes 
Checking for function mkdtemp            : yes 
Checking for flags -Wl,--as-needed       : yes 
'configure' finished successfully (6.465s)
'make_all' finished successfully (0.049s)
Waf: Entering directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/debug'
[ 1/13] Compiling src/main.c
[ 2/13] Compiling src/pyi_archive.c
[ 3/13] Compiling src/pyi_global.c
[ 4/13] Compiling src/pyi_launch.c
[ 5/13] Compiling src/pyi_main.c
[ 6/13] Compiling src/pyi_path.c
[ 7/13] Compiling src/pyi_python.c
[ 8/13] Compiling src/pyi_python27_compat.c
[ 9/13] Compiling src/pyi_pythonlib.c
[10/13] Compiling src/pyi_utils.c
[11/13] Compiling src/pyi_win32_utils.c
[12/13] Linking build/debug/run_d
[13/13] Processing build/debug/run_d
Waf: Leaving directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/debug'
'build_debug' finished successfully (4.221s)
Waf: Entering directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/release'
[ 1/13] Compiling src/main.c
[ 2/13] Compiling src/pyi_archive.c
[ 3/13] Compiling src/pyi_global.c
[ 4/13] Compiling src/pyi_launch.c
[ 5/13] Compiling src/pyi_main.c
[ 6/13] Compiling src/pyi_path.c
[ 7/13] Compiling src/pyi_python.c
[ 8/13] Compiling src/pyi_python27_compat.c
[ 9/13] Compiling src/pyi_pythonlib.c
[10/13] Compiling src/pyi_utils.c
[11/13] Compiling src/pyi_win32_utils.c
[12/13] Linking build/release/run
[13/13] Processing build/release/run
Waf: Leaving directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/release'
'build_release' finished successfully (4.135s)
Waf: Entering directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/debug'
[14/14] Processing build/debug/run_d
+ install /build/pyinstallerbootloader/PyInstaller-3.3.1/PyInstaller/bootloader/Linux-64bit-aarch/run_d (from build/debug/run_d)
Waf: Leaving directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/debug'
'install_debug' finished successfully (0.182s)
Waf: Entering directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/release'
[14/14] Processing build/release/run
+ install /build/pyinstallerbootloader/PyInstaller-3.3.1/PyInstaller/bootloader/Linux-64bit-aarch/run (from build/release/run)
Waf: Leaving directory `/build/pyinstallerbootloader/PyInstaller-3.3.1/bootloader/build/release'
'install_release' finished successfully (0.180s)
Removing intermediate container 86ce24cc0397
 ---> 97de2d3bae1e
Step 11/15 : WORKDIR /build/dockercompose
 ---> Running in c7a490364841
Removing intermediate container c7a490364841
 ---> b95751703b9e
Step 12/15 : RUN git clone https://github.com/docker/compose.git .     && git checkout $DOCKER_COMPOSE_VER
 ---> Running in 1988733a4cdc
Cloning into '.'...
Note: checking out '1.22.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at e20d808e... Merge pull request #6087 from docker/bump-1.22.0
Removing intermediate container 1988733a4cdc
 ---> 956b49107034
Step 13/15 : RUN mkdir ./dist     && pip install -q -r requirements.txt -r requirements-build.txt     && ./script/build/write-git-sha     && pyinstaller docker-compose.spec     && mv dist/docker-compose ./docker-compose-$(uname -s)-$(uname -m)
 ---> Running in 5bc3821309ec
You are using pip version 10.0.1, however version 20.2b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2069 INFO: PyInstaller: 3.3.1
2071 INFO: Python: 3.6.5
2084 INFO: Platform: Linux-5.3.0-53-generic-aarch64-with-debian-9.4
2090 INFO: UPX is not available.
2102 INFO: Extending PYTHONPATH with paths
['/build/dockercompose/bin', '/build/dockercompose']
2102 INFO: checking Analysis
2103 INFO: Building Analysis because out00-Analysis.toc is non existent
2104 INFO: Initializing module dependency graph...
2111 INFO: Initializing module graph hooks...
2125 INFO: Analyzing base_library.zip ...
51050 INFO: running Analysis out00-Analysis.toc
51370 INFO: Caching module hooks...
51474 INFO: Analyzing bin/docker-compose
52927 INFO: Processing pre-find module path hook   distutils
55228 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
78151 INFO: Processing pre-safe import module hook   six.moves
93747 INFO: Loading module hooks...
93750 INFO: Loading module hook "hook-requests.py"...
93761 INFO: Loading module hook "hook-xml.py"...
94598 INFO: Loading module hook "hook-pydoc.py"...
94602 INFO: Loading module hook "hook-jsonschema.py"...
94612 INFO: Loading module hook "hook-certifi.py"...
94623 INFO: Loading module hook "hook-encodings.py"...
95366 INFO: Loading module hook "hook-distutils.py"...
95709 INFO: Looking for ctypes DLLs
96159 INFO: Analyzing run-time hooks ...
96367 INFO: Looking for dynamic libraries
104077 INFO: Looking for eggs
104078 INFO: Using Python library /usr/local/lib/libpython3.6m.so.1.0
104142 INFO: Warnings written to /build/dockercompose/build/docker-compose/warndocker-compose.txt
104996 INFO: Graph cross-reference written to /build/dockercompose/build/docker-compose/xref-docker-compose.html
105258 INFO: checking PYZ
105259 INFO: Building PYZ because out00-PYZ.toc is non existent
105259 INFO: Building PYZ (ZlibArchive) /build/dockercompose/build/docker-compose/out00-PYZ.pyz
111941 INFO: Building PYZ (ZlibArchive) /build/dockercompose/build/docker-compose/out00-PYZ.pyz completed successfully.
112106 INFO: checking PKG
112107 INFO: Building PKG because out00-PKG.toc is non existent
112108 INFO: Building PKG (CArchive) out00-PKG.pkg
138986 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
139031 INFO: Bootloader /usr/local/lib/python3.6/site-packages/PyInstaller/bootloader/Linux-64bit-aarch/run
139032 INFO: checking EXE
139033 INFO: Building EXE because out00-EXE.toc is non existent
139033 INFO: Building EXE from out00-EXE.toc
139035 INFO: Appending archive to ELF section in EXE /build/dockercompose/dist/docker-compose
139117 INFO: Building EXE from out00-EXE.toc completed successfully.
Removing intermediate container 5bc3821309ec
 ---> 1ac7cb93531f
Step 14/15 : VOLUME /dist
 ---> Running in cb8f4e1b9ebd
Removing intermediate container cb8f4e1b9ebd
 ---> 2bfc769b950d
Step 15/15 : CMD cp docker-compose-* /dist
 ---> Running in 600111b4006d
Removing intermediate container 600111b4006d
 ---> d2bf5cad117d
Successfully built d2bf5cad117d
Successfully tagged docker-compose-aarch64-builder:latest

$ docker run --rm -v "$(pwd)":/dist docker-compose-aarch64-builder
$ file docker-compose-Linux-aarch64 
docker-compose-Linux-aarch64: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=4c080b15eb7259de6a4ef6420e760af8b5675e42, stripped

$ scp docker-compose-Linux-aarch64 [email protected]:~/
$ ssh [email protected] "uname -a; ~/docker-compose-Linux-aarch64 version"
[email protected]'s password: 
Linux amv-jetson-xavier-nx 4.9.140-tegra #1 SMP PREEMPT Wed Apr 8 18:15:20 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux
docker-compose version 1.22.0, build e20d808e
docker-py version: 3.4.1
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.1.0f  25 May 2017

@hmahadik
Copy link

hmahadik commented Jun 7, 2020 via email

@samip5
Copy link

samip5 commented Jun 18, 2020

Yup, the issue is this:

RPi4-01 ~/docker-compose-aarch64/vendor/qemu-bin # ls -al
total 4768
drwxr-xr-x 2 root root    4096 Jun 18 22:51 .
drwxr-xr-x 3 root root    4096 Jun 18 22:51 ..
lrwxrwxrwx 1 root root      12 Jun 18 22:51 cross-build-end -> resin-xbuild
lrwxrwxrwx 1 root root      12 Jun 18 22:51 cross-build-start -> resin-xbuild
-rwxr-xr-x 1 root root 3451880 Jun 18 22:51 qemu-aarch64-static
-rwxr-xr-x 1 root root 1418080 Jun 18 22:51 resin-xbuild
lrwxrwxrwx 1 root root       2 Jun 18 22:51 sh.real -> sh
RPi4-01 ~/docker-compose-aarch64/vendor/qemu-bin # file resin-xbuild
resin-xbuild: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=x95jfP8worDP3Zvp0lua/nI-z0Qk_K3rYeThxN6iT/-MonllK4ibkaSDHWEpN9/Nt31KVEVp3CfQgfUVKaG, stripped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants