I'm using a MacBook Pro with the M2 processor (arm64
) but I need to start a devcontainer with an amd64
version of the Python image (buster):
Docker image: mcr.microsoft.com/devcontainers/python:0-3.11-buster
This is what I've tried so far:
Add platform
in the Dockerfile
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
Setting the DOCKER_DEFAULT_PLATFORM
environment variable in .zshrc
DOCKER_DEFAULT_PLATFORM=linux/amd64
Set runArgs
in devcontainer.json
"runArgs": [
"--platform=linux/amd64"
],
But for all of them I receive the following error when building the container:
[183642 ms] Start: Run: docker inspect --type image mcr.microsoft.com/vscode/devcontainers/python:3.11-buster
[185190 ms] Error fetching image details: No manifest found for mcr.microsoft.com/vscode/devcontainers/python:3.11-buster.
[185190 ms] Start: Run: docker pull mcr.microsoft.com/vscode/devcontainers/python:3.11-buster
3.11-buster: Pulling from vscode/devcontainers/python
no matching manifest for linux/arm64/v8 in the manifest list entries
[186436 ms] []
[186436 ms] Error response from daemon: No such image: mcr.microsoft.com/vscode/devcontainers/python:3.11-buster
How can I fix the platform to linux/amd64
?