Skip to content

Conversation

@mateo-moon
Copy link
Contributor

Description

This PR fixes devcontainer build failures on Apple Silicon Macs by enforcing the linux/amd64 platform.

Changes

  • Replace image property with build using Dockerfile approach
  • Add Dockerfile with explicit --platform=linux/amd64 flag
  • Add runArgs and remoteEnv to enforce platform consistently
  • Maintains backward compatibility for Linux users

Problem

On Apple Silicon Macs, VSCode devcontainers were building arm64 versions by default, causing:

  • Image pull errors
  • Platform mismatch issues
  • Incompatibility with cloud provider tooling

Solution

By explicitly specifying --platform=linux/amd64 in the Dockerfile and devcontainer configuration, the container will always build for amd64 architecture, ensuring consistent behavior across different host platforms.

Testing

  • ✅ Tested on macOS (Apple Silicon) with OrbStack
  • ✅ Should work on Linux/amd64 (native platform)
  • ✅ Should work on Linux/arm64 (via QEMU emulation)

Backward Compatibility

The Dockerfile approach maintains backward compatibility as it builds the same base image (mcr.microsoft.com/devcontainers/base:ubuntu), just with explicit platform enforcement. On Linux/amd64 systems, this adds no performance overhead.

@mateo-moon mateo-moon requested a review from a team as a code owner November 3, 2025 16:17
…patibility

- Replace image property with build using Dockerfile
- Add Dockerfile with explicit --platform=linux/amd64 flag
- Add runArgs and remoteEnv to enforce platform consistently
- Fixes devcontainer build failures on Apple Silicon Macs

Signed-off-by: OP <[email protected]>
@mateo-moon mateo-moon force-pushed the fix/devcontainer-platform-enforcement branch from b9047d3 to fe5d548 Compare November 3, 2025 16:18
@mateo-moon
Copy link
Contributor Author

I didn't properly check backwards compatibility on linux machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant