I have an NVIdia Jetson TX2 that ive successful hooked up to IoT Hub.
its an ARM64v8 ( arch64 ) device.
but my development environment is AMD64.
when i try to build the solution it fails with
standard_init_linux.go:190: exec user process caused "exec format error"
Step 1/12 : FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster-arm64v8 AS build-env
---> 0ca5aebeb047
Step 2/12 : WORKDIR /app
---> Using cache
---> 6c2033b25d95
Step 3/12 : COPY *.csproj ./
---> Using cache
---> 0ba74f345874
Step 4/12 : RUN dotnet restore
---> Running in 4a648bee3a74
standard_init_linux.go:190: exec user process caused "exec format error"
it works fine when i set my environment to AMD64, it even runs on the Nvidia jetson!
but i cant build it from my local machine.
i got here because i started with the following
https://github.com/toolboc/IntelligentEdgeHOL
then when that didnt work for me i found your article
https://devblogs.microsoft.com/iotdev/develop-and-debug-arm64-iot-edge-modules-in-visual-studio-code-preview/
Be able to develop modules in my development machine and just press a button and deploy them to the device.
not able to build and this push my module because my dev machine is a different architecture than the edge device even though both are 64 bit and bott run Ubuntu 18.04
Preferences Settings.json...
"azure-iot-edge.platforms": {
"amd64": [],
"arm32v7": [],
"windows-amd64": [],
"arm64v8": [],
},
"azure-iot-edge.version.csharpmodule": "3.0.0-alpha"
Set default platform to arm64v8
dev box: ubuntu 18.04
edge device: nvidia jetson tx2
iotedge checksudo iotedge check
[sudo] password for meta:
โ config.yaml is well-formed
โ config.yaml has well-formed connection string
โ container engine is installed and functional
โ config.yaml has correct hostname
โ config.yaml has correct URIs for daemon mgmt endpoint
โผ latest security daemon
Installed IoT Edge daemon has version 1.0.8~rc1 but version 1.0.8 is available.
Please see https://aka.ms/iotedge-update-runtime for update instructions.
โ host time is close to real time
โ container time is close to host time
โผ DNS server
Container engine is not configured with DNS server setting, which may impact connectivity to IoT Hub.
Please see https://aka.ms/iotedge-prod-checklist-dns for best practices.
You can ignore this warning if you are setting DNS server per module in the Edge deployment.
โผ production readiness: certificates
Device is using self-signed, automatically generated certs.
Please see https://aka.ms/iotedge-prod-checklist-certs for best practices.
โ production readiness: certificates expiry
โผ production readiness: container engine
Device is not using a production-supported container engine (moby-engine).
Please see https://aka.ms/iotedge-prod-checklist-moby for details.
โผ production readiness: logs policy
Container engine is not configured to rotate module logs which may cause it run out of disk space.
Please see https://aka.ms/iotedge-prod-checklist-logs for best practices.
You can ignore this warning if you are setting log policy per module in the Edge deployment.
โ host can connect to and perform TLS handshake with IoT Hub AMQP port
โ host can connect to and perform TLS handshake with IoT Hub HTTPS port
โ host can connect to and perform TLS handshake with IoT Hub MQTT port
โ container on the default network can connect to IoT Hub AMQP port
โ container on the default network can connect to IoT Hub HTTPS port
โ container on the default network can connect to IoT Hub MQTT port
โ container on the IoT Edge module network can connect to IoT Hub AMQP port
โ container on the IoT Edge module network can connect to IoT Hub HTTPS port
โ container on the IoT Edge module network can connect to IoT Hub MQTT port
โ Edge Hub can bind to ports on host
One or more checks raised warnings. Re-run with --verbose for more details.
Click here
// Paste here
Ubuntu 18.04
amd64
Linux
1.0.8
1.0.8
<Run `docker version` (`docker -H npipe:////./pipe/iotedge_moby_engine version` for Moby on Windows) and paste here>
dev box : 18.03.1-ce
device: 18.09.2
iotedged logs
<Paste here>
edge-agent logs
<Paste here>
edge-hub logs
<Paste here>
So now if i switch my module to
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build-env
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-buster-slim
its builds on the dev machine but when device goes to pull and run it the docker logs say
standard_init_linux.go:207: exec user process caused "exec format error"
If I understand correctly, you want to build a ARM64 docker image running your .net console app on amd64 machine. To do this, you need to have 2 stages in docker file. I drafted a sample docker file for your reference below.
FROM
dotnet publish -r linux-arm64 -c Release -f netcoreapp2.1
FROM
COPY --from=builder
CMD
actually the publish command should be
RUN dotnet publish -r linux-arm -c Release -o out -f netcoreapp3.0
since im trying on raspberry pi which is arm32 ( before i was using nvidia jetson which is arm64)
if i publish to linux-arm64 like you said i get errors.
( on the raspberry pi)
in addition of note is that the build stage should be a 64bit AMD container
e.g. sdk:3.0-stretch
otherwise the publish command wont work.
also dotnet publish actually does an implicit dotnet restore
https://github.com/dotnet/announcements/issues/23
finally here is my dockerfile that worked but its probably not ideal practice to develop and build modules on a dev machine thats a different architecture than the device you will deploy to.
even if its just nodejs or python because some of those node or python dependencies actually compile when you install them
but heres the rub...
there is not version of visual studio code that runs on 32bit CPU!. so even if i bought an extra device just for development, ----->it wouldnt work!!! <------
i guess the only solution is to use visual studio code just to get a shell of the project into source control then i can git clone that thing onto a 32 bit operating system for the rest of the development lifecycle?
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-stretch AS build-env
WORKDIR /app
COPY *.csproj ./
COPY . ./
RUN dotnet publish -r linux-arm -c Release -o out -f netcoreapp3.0
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-stretch-slim-arm32v7
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "SampleModule51.dll"]
ok had to upgrade to Docker version 19.03.1, build 74b1e89 on the development machine and on the pi
not sure how thats going to work with moby-engine
so ill leave regular docker for now.
otherwise you get an error trying to bind to remote docker over ssh
wow that actually worked.
@
wow that actually worked.
Hi @juansuerogit , did that link work which @veyalla has sent. I'm trying to develop the module in my system ( amd architecture) to deploy in Jetson nano (arm64) following this link too, but I'm getting error like( build an image in Windows against a non windows system ) and deployed to the edge but no response on Jetson , Tll me plz will it work if it is developed on a AMD machine for a arm64 when we set VScode environment for Arm64.