vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Start remote-containers for a different platform? (amd64 in mac M1)

Open hecontreraso opened this issue 3 years ago • 1 comments
trafficstars

So I have docker environment, and want to attach my editor to a container.

But I need to specify the platform while building, otherwise it doesn't work

This build command works:

docker buildx build --file Dockerfile.local --platform linux/amd64 -t webapp . --load

However, when I use "Open folder in container" option, I found in the build log that it's being started with this command:

docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /Users/macbook/webapp/Dockerfile.local -t vsc-webapp-d6a884082a6b83d4c1a0444e21b1d8e0 /Users/macbook/webapp

So the build Fails.

How can I tell remote-containers to use --platform linux/amd64 while building?

I tried adding this to devcontainer.json and didn't work:

"build": { "args": { "DOCKER_DEFAULT_PLATFORM": "linux/amd64" }} "containerEnv": { "DOCKER_DEFAULT_PLATFORM": "linux/amd64" }

hecontreraso avatar Aug 16 '22 16:08 hecontreraso

Could you check why BuildKit is not using your actual platform as the default? (Also make sure to update to the latest version of Docker Desktop, if that's what you are using.)

chrmarti avatar Sep 08 '22 07:09 chrmarti

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

github-actions[bot] avatar Dec 02 '22 12:12 github-actions[bot]