I recently got an M1 Mac powerbook, thinking that I could code in C# on dotnet core 3.1. My previous development environment was Windows 10 where we used linux containers.
I can build and start my containers without issue. But when I use them the main api host dies with error 139. The docker community says this is a segmentation fault.
Based on the log, the code is making a rest call to Google for Recaptcha.
_logger.LogInformation("About to call rest api on {RecaptchaVerificationEndpointV2}");
var response = await _restClient.ExecuteAsync(request);
_logger.LogInformation("Called rest api");
The log has "About to call..." but not "Called...". This is the first call outside the container's network.
My question is - how can I troubleshoot this?
I guess that either there is some incompatibility with the platform (e.g. that dotnet 3.1 has a limitation on arm64) OR a firewall is blocking the call.
The only information I have is the code 139. Which is shown both in docker and in rider:

As background, I have dotnet 6.0.1 installed. Docker is current - 4.4.2 (73305).
The container that dies is based on this image:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
I got the same result with mcr.microsoft.com/dotnet/core/aspnet:3.1.416-bullseye-arm64v8.
Everything I've read from MS says this should be supported. Based on https://docs.microsoft.com/en-us/dotnet/core/install/macos I tried installing libgdiplus.
When i try building for platform=linux/amd64, i get a different error:
#23 13.60 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c dotnet restore ./********.csproj]: exit code: 139
(project name removed).