Search code examples
c#.netdockerdigital-ocean-apps

failed to load /usr/bin/dotnet: exec format error


I'm trying to use DigitalOcean to host a C# docker container on docker hub (With the Apps platform)

[2021-12-08 23:24:04] starting container: starting non-root container [dotnet Alace.cs.dll]: creating process: failed to load /usr/bin/dotnet: exec format error

The container runs perfectly fine on my computer.


Solution

  • Your image is built for an Arm processor and the DigitalOcean machine is probably an amd64 machine.

    You can try building for amd64 with the buildx command. Something like

    docker buildx build --platform linux/amd64 -t alyxw/alace-cs:amd64 .