-
Notifications
You must be signed in to change notification settings - Fork 2
Minor changes Apple silicon dev #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| services: | ||
| devcontainer: | ||
| platform: linux/amd64 | ||
photocyte marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separately, can you have github build a Codespace off your current branch and confirm that's still functional?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. anytime we're messing around with the guts of the devcontainer configuration, it's good to ensure it's still compatible with Github Codespaces |
||
| build: | ||
| context: . | ||
| args: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,4 +76,8 @@ dist | |
| *.log | ||
| **/logs/log*.txt | ||
|
|
||
| # macOS dev cleanliness | ||
| *.DS_Store | ||
| .DS_Store | ||
|
|
||
| # Ignores specific to this repository | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Pinning platform to linux/amd64 may cause build/run platform mismatches; make it overridable and verify Dockerfile honors TARGETPLATFORM.
On Apple Silicon this fixes devcontainers by forcing x86 emulation, but when the service is built locally (build: context: .), Compose can error if the built image is arm64 while the service requests amd64. Suggest making the platform opt-in via env var (keeps your default) and ensure the Dockerfile uses ARG TARGETPLATFORM or FROM --platform to build the correct arch.
Apply this small improvement so developers can override without editing the file:
To verify your build path won’t mismatch, run this in the repo to check Dockerfiles for platform-awareness:
🏁 Script executed:
Length of output: 3272
Make devcontainer platform configurable and remove the hard amd64 pin in the Dockerfile
I ran the check — .devcontainer/Dockerfile contains a hard pin (line 4: FROM --platform=linux/amd64) and devcontainer.json uses docker-compose.yml. Please make these changes so the platform can be overridden and the Dockerfile honors TARGETPLATFORM.
Files to change
Suggested diffs
For .devcontainer/docker-compose.yml:
For .devcontainer/Dockerfile (replace the pinned FROM):
Note: using ARG in FROM requires BuildKit / recent Docker; if you cannot rely on that, consider removing the --platform flag from the Dockerfile and controlling platform via the compose env var instead.
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right solution, given that the development platform has to match the deployment platform, and the deployment platform is infrastructure as code elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@photocyte That's a valid point about maintaining dev/prod parity - it's definitely important to avoid environment drift that could cause deployment issues.
To better understand the context: is your deployment platform definitively amd64/x86_64? If so, then keeping the hard-coded
platform: linux/amd64makes sense for consistency.The original issue was helping Apple Silicon developers get started with dev-containers. If maintaining the amd64 platform is the right approach for your infrastructure, then your solution addresses that need while preserving the deployment alignment you mentioned.
I'll note that this approach means Apple Silicon developers will run under emulation, which works but may have some performance implications during development. However, if that tradeoff is acceptable for maintaining environment consistency, then your approach is sound.