Closed LennartKleymann closed 9 months ago
@LennartKleymann can you provide some more information, like an https://aka.ms/binlog of the publish step?
BinLog is a little bit complicated, because it contains sensitive data for me. Can I share it to you privately? @baronfel
Sure! Create a new developer community ticket here, and once you've created the ticket you can upload the binlog privately to that site. Then you can comment back here with the link to the ticket you just created and I'll be able to securely access the binlog.
Okay thanks. I attached the binlog to a private comment for microsoft only. https://developercommunity.visualstudio.com/t/sdk-container-builds:-with-own-base-imag/10461318
Hi @LennartKleymann - I took a look at your binlog (thank you!) and what I found is that your base image is for a different architecture than your packaged application:
arm64
in Docker termslinux-x64
in .NET terms, which is amd64
in Docker termsas a result, the binaries built from your publish
command are incompatible with your base image. You have two solutions here:
linux-x64
applications:
docker manifest
version of your base image - i.e. an image that points to different architecture-specific images. This is what the .NET images do.linux-arm64
- the SDK Container tooling supports this by adhering to the -r
runtime selection CLI optionSeparately, I'm going to log an issue against our tooling - when the base image is a single image (not a manifest list) we currently assume that the architectures match. We should actually verify this and error out, since the application will not be able to run in this scenario.
@LennartKleymann can you take a look at this comment? This is what I'm hoping to get into .NET 8 that would identify and force you to handle this error case.
@baronfel Hey, sorry for the late response. With building my base image on the correct plattform my publsih of my API works.
I think that the comment you link is really good to prevent confusion, thank you really much.
If i publish using this command:
dotnet publish -c Release -p:ContainerBaseImage=registry-1.docker.io/kleymannl/dotnet-libfontconfig1:latest -p:ContainerImageName=replaced/replaced -p:RuntimeIdentifier=linux-x64
the container is not starting anymore and I get following error message:
replaced.path: no such file or directory
My base image looks like this: