Skip to content
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

specifying --platform in .devcontainer.json #7779

Closed
AbdulAbCellera opened this issue Jan 1, 2023 · 3 comments
Closed

specifying --platform in .devcontainer.json #7779

AbdulAbCellera opened this issue Jan 1, 2023 · 3 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@AbdulAbCellera
Copy link

AbdulAbCellera commented Jan 1, 2023

This is more of a question than an issue:

Host: macOS arm64
Image: mcr.microsoft.com/devcontainers/base:jammy

>> docker manifest inspect mcr.microsoft.com/devcontainers/base:jammy
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1786,
         "digest": "sha256:54d1fd0219908ba82b67230aabf350cf72dcab012d48111dccaf18209a56d1e4",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1786,
         "digest": "sha256:aec79b5e88157fa7e4b3ec9af83a48bce0f1435ee982ecd65680c27a3ab877af",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      }
   ]
}

when I choose the vscode command Rebuild and Reopen in Container, I get a container with an arm64 arch (matching host). Setting export DOCKER_DEFAULT_PLATFORM=linux/amd64 in ~/.zshrc did not help.

The Question:

  • how to specify --platfrom=linux/amd64 in .devcontainer.json
@AbdulAbCellera
Copy link
Author

This worked for me
"image": "mcr.microsoft.com/devcontainers/base:jammy@sha256:54d1fd0219908ba82b67230aabf350cf72dcab012d48111dccaf18209a56d1e4",

However, if I want the latest image this would not do it.

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jan 1, 2023
@chrmarti chrmarti self-assigned this Jan 9, 2023
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jan 9, 2023
@chrmarti
Copy link
Contributor

chrmarti commented Jan 9, 2023

You could use a Dockerfile with --platform in FROM: https://docs.docker.com/engine/reference/builder/#from

@github-actions
Copy link

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 github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants