Skip to content

Commit fe5d548

Browse files
committed
fix(devcontainer): enforce linux/amd64 platform for Apple Silicon compatibility
- 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]>
1 parent 2ad507b commit fe5d548

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/base:ubuntu
2+
3+

.devcontainer/development/devcontainer.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,29 @@
33
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
44
{
55
"name": "General development container",
6-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": ".",
9+
"args": {
10+
"BUILDKIT_INLINE_CACHE": "1"
11+
}
12+
},
713
"postCreateCommand": "bash .devcontainer/development/scripts/postCreateCommand.sh",
14+
"runArgs": ["--platform=linux/amd64"],
815
"capAdd": [
916
"CAP_AUDIT_WRITE"
1017
],
1118
"features": {
12-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
13-
"ghcr.io/devcontainers/features/go:1": {}
19+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
20+
"version": "latest"
21+
},
22+
"ghcr.io/devcontainers/features/go:1": {
23+
"version": "latest"
24+
}
25+
},
26+
"remoteEnv": {
27+
"DOCKER_BUILDKIT": "0",
28+
"DOCKER_DEFAULT_PLATFORM": "linux/amd64"
1429
},
1530
"containerEnv": {
1631
"CONTAINER_WORKSPACE_FOLDER": "${containerWorkspaceFolder}"

0 commit comments

Comments
 (0)