I have a Dockerfile that works on both mac and windows.But when I create an actual container on mac, I always get a warning that says:
PS /Users/me/> docker run -it platformtest /bin/bashWARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requestedroot@0569c6d5ad39:/builds# exit
This is despite the fact that when I create the image, I'm specifying amd64. Here's the relevant part of the Dockerfile:
FROM --platform=amd64 mcr.microsoft.com/dotnet/sdk:6.0.202-bullseye-slim-amd64 AS deployFunctionAppRUN apt update && apt-get install vim -yCOPY . /buildsRUN curl -sL https://aka.ms/InstallAzureCLIDeb | bashRUN apt-get install curl && curl -sL https://deb.nodesource.com/setup_12.x | bash -RUN apt-get install nodejs
And the command I use to create the image is:
docker build --target deployFunctionApp -t myimagename .
The build happens with no errors or warnings.
Questions
Why do I get this warning eventhough i've specified the platform during the build process?It seems that I can safely ignore it, cuz everything seems to be working. Is there anything that I should be looking out for?Any way to suppress this message?