4

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.

Alyx
  • 436
  • 4
  • 16

1 Answers1

9

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 .
Hans Kilian
  • 18,948
  • 1
  • 26
  • 35
  • 1
    It’s strange OP can run that thing on their computer. Maybe they use an apple computer with M1 CPU? – Soonts Dec 09 '21 at 00:45
  • 6
    Lots of people have M1 Macbooks, so it not that strange :) – Hans Kilian Dec 09 '21 at 00:50
  • Yes, I am on an m1, thank you so much! – Alyx Dec 09 '21 at 00:57
  • @Alyx Consider using ARM64 CPUs on the cloud too. I have once made a cloud app in .NET Core running on a public cloud, in my case ARM VMs which I ended up using were 2.5x cheaper than a traditional AMD64 VMs. Another nice side effect, you won’t need another version of these docker images. However, single-threaded performance is better on traditional Xeons and Epics, so that’s a trade-off. – Soonts Dec 09 '21 at 01:29
  • @Soonts do you know if DigitalOcean supports ARM64? I have a bunch of credit with them so I'm determined to make that work – Alyx Dec 09 '21 at 19:11
  • When you make a droplet, the only CPU options are Intel or AMD as far as I can see – Hans Kilian Dec 09 '21 at 23:22
  • @Alyx I’m afraid it does not. Among the large cloud provides, arm64/Linux VMs are available on Amazon and Oracle. – Soonts Dec 12 '21 at 19:39