while running on mac, getting error because the image is created in "arm64" format.
Solution : run the following command to specify the image platform, then your image will be created in "amd64" :-
docker buildx build --platform linux/amd64 -f ./Dockerfile -t name-of-your-image .