-
Describe the BugWhen I tried to run image on my server, I got following error and application is not running:
Steps to ReproduceI have following
For building the image I tried this command:
I test architecture after build like this:
I got When I tried to run this image on my server, I got following error and application is not running:
What I tried also:
Output of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @skoruba. If I'm reading correctly, you want to build your image on your arm64 machine and run it on your amd64 server. You used the There are a couple things to unpack here. First, a cross-platform build is preferable to building under emulation. What I mean is, your build stage should run as The In your Dockerfile, you manually specified Take a look at our sample Dockerfile which supports cross-platform builds: dotnet-docker/samples/aspnetapp/Dockerfile Lines 1 to 22 in 81f0bdf This Dockerfile supports cross-builds in both directions ( |
Beta Was this translation helpful? Give feedback.
Without seeing your updated Dockerfile, it's hard to tell what's going wrong. I think you most likely need to remove the
--platform $BUILDPLATFORM
from your base (runtime) layer. Then it will be implicitly set to$TARGETPLATFORM
by Docker.Then your Dockerfile would be: