Cross Compile module for arm32v7 on Windows
jlorek opened this issue · 3 comments
VSCode
Version: 1.39.2 (system setup)
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:35:10.237Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT ia32 10.0.17763
Docker Toolbox 19.03.1
Hi,
when try to build a module for arm32v7 it results in the following error:
Step 10/12 : RUN useradd -ms /bin/bash moduleuser
---> Running in d9208d7ab13a
standard_init_linux.go:211: exec user process caused "exec format error"
Is this due to docker limitations (mismatch between host architecture and target architecture)?
If so, do i need to run my build on a dedicated arm device (like a Raspberry Pi)?
If so, what is the recommended setup to run arm builds in a CI environment like Azure DevOps?
Thanks!
Hi @jlorek you need to build arm32v7 images on an arm32v7 machine.
On your development machine, you can follow @czgtest 's suggestion to build and run your image on a remote device
In a CI environment, you need to setup a self-hosted arm32v7 agent if the CI service you're using doesn't provide arm32v7 agents. Here's a document about how to use Azure DevOps for IoT Edge, which includes how to set up arm32v7 agent: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-ci-cd You can try similar steps on other CI services.
Solved my issues by upgrading from Docker Toolbox (19.03.1) to the latest version of Docker Desktop (2.1.0.4). Building containers for Arm32v7 using the the VS Code IoT Edge Extension now works without any issues. Also pushed the resulting contains to a Raspberry test device.
So cross-compiling for Arm32v7 on an Amd64 architecture works just fine 👌