I'm working on a FastAPI app that I'm running in Docker and deploying as an AWS Lambda using Serverless. I have a Windows laptop with WSL2 Ubuntu, while my colleague is using a Mac. When I try to deploy, I encounter the error: "The image manifest, config or layer media type for the source image [imageid] is not supported." I've tried various fixes with no luck, and interestingly, everything works perfectly for my colleague on their Mac. If I comment out the Docker section for the FastAPI Lambda, the rest of my stack deploys without any issues. Has anyone else faced similar problems or can suggest what might be going wrong?
4 Answers
It seems like you might have mixed x86_64 and arm64 components. Your Windows machine is likely Intel, while your colleague could be on an ARM Mac. If some parts are built on your machine and others on theirs, it could lead to compatibility issues. Ensure everything is built for the same platform.
You could be dealing with some binary dependencies that aren't compatible. While Python packages tend to work cross-platform, specific binary dependencies need to match the OS and architecture they're being deployed on. Double-check those components!
This error is from the Serverless Framework itself. It might be worth reporting this issue directly on their GitHub page to see if they have specific advice for your case.
It sounds like the issue might be related to the build platform. AWS can sometimes expect a specific argument like `--build-platform amd64` for x86_64 architectures. If you're building on Mac, it could be generating an arm version if they're on Apple silicon. Make sure the build architecture is consistent across both systems and see if that helps!
I suspected that might be the issue too, but I still get the same error whether I build for `amd64` or `arm64`. We thought we were aligned, but maybe there's still a discrepancy somewhere.
I've tried explicitly building for both architectures, but the same error shows up. We thought everything was aligned, but clearly, there's something we're still missing.