Alyx
Alyx

Reputation: 501

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.

Upvotes: 8

Views: 12490

Answers (2)

Mohamed Bakr
Mohamed Bakr

Reputation: 429

if you working with dotnet 8 you can only change the base image to

mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim-amd64

and you can do a normal docker build.

and no need to use "--platform linux/amd64 " parameter while building docker image

Upvotes: 0

Hans Kilian
Hans Kilian

Reputation: 25622

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 .

Upvotes: 19

Related Questions