microsoft / microsoft/vscode-remote-release

Dockerfile 'platform' argument in 'from' command seems to get ignored.

Open
#8,737 1 comment 3 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Jul 27, 2023.

bug containers
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I'm on a Macbook Pro, with Apple M2 chip (ARM64).

I have a folder called 'devcontainer-test' in which a dockerfile is placed that contains the following:

FROM --platform=linux/amd64 pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1

I can build this dockerfile without issue

docker build .

However, when I try to 'Open folder in container...', it fails to build, the log is shown below

[2023-07-21T07:18:08.875Z] Dev Containers 0.299.0 in VS Code 1.80.1 (74f6148eb9ea00507ec113ec51c489d6ffb4b771).
[2023-07-21T07:18:08.875Z] Start: Run: git rev-parse --abbrev-ref --symbolic-full-name @{u}
[2023-07-21T07:18:08.884Z] Stop (9 ms): Run: git rev-parse --abbrev-ref --symbolic-full-name @{u}
[2023-07-21T07:18:44.428Z] Start: Run: docker version --format {{.Server.APIVersion}}
[2023-07-21T07:18:44.486Z] Stop (58 ms): Run: docker version --format {{.Server.APIVersion}}
[2023-07-21T07:18:44.486Z] 1.43
[2023-07-21T07:18:48.817Z] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/dennis/.vscode/extensions/ms-vscode-remote.remote-containers-0.299.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/dennis/Documents/projects/devcontainer-test --log-level debug --log-format json --config /Users/dennis/Documents/projects/devcontainer-test/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true
[2023-07-21T07:18:48.943Z] @devcontainers/cli 0.46.0. Node.js v16.17.1. darwin 22.5.0 arm64.
[2023-07-21T07:18:48.943Z] Start: Run: git rev-parse --show-cdup
[2023-07-21T07:18:48.951Z] Stop (8 ms): Run: git rev-parse --show-cdup
[2023-07-21T07:18:48.952Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/dennis/Documents/projects/devcontainer-test --filter label=devcontainer.config_file=/Users/dennis/Documents/projects/devcontainer-test/.devcontainer/devcontainer.json
[2023-07-21T07:18:48.990Z] Stop (38 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/dennis/Documents/projects/devcontainer-test --filter label=devcontainer.config_file=/Users/dennis/Documents/projects/devcontainer-test/.devcontainer/devcontainer.json
[2023-07-21T07:18:48.990Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/dennis/Documents/projects/devcontainer-test
[2023-07-21T07:18:49.029Z] Stop (39 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/dennis/Documents/projects/devcontainer-test
[2023-07-21T07:18:49.031Z] Start: Run: docker inspect --type image pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1
[2023-07-21T07:18:49.071Z] Stop (40 ms): Run: docker inspect --type image pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1
[2023-07-21T07:18:49.481Z] Start: Run: docker-credential-desktop get
[2023-07-21T07:18:49.665Z] Stop (184 ms): Run: docker-credential-desktop get
[2023-07-21T07:18:50.884Z] Error fetching image details: No manifest found for docker.io/pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1.
[2023-07-21T07:18:50.885Z] Start: Run: docker pull pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1
[2023-07-21T07:18:52.903Z] base-cuda-py3.10-torch1.13-cuda11.7.1: Pulling from pytorchlightning/pytorch_lightning
[2023-07-21T07:18:52.903Z] no matching manifest for linux/arm64/v8 in the manifest list entries
[2023-07-21T07:18:52.910Z] Stop (2025 ms): Run: docker pull pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1
[2023-07-21T07:18:52.911Z] []
[2023-07-21T07:18:52.911Z] Error response from daemon: No such image: pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1

[2023-07-21T07:18:52.911Z] Command failed: docker inspect --type image pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1
[2023-07-21T07:18:52.919Z] Stop (4102 ms): Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/dennis/.vscode/extensions/ms-vscode-remote.remote-containers-0.299.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /Users/dennis/Documents/projects/devcontainer-test --log-level debug --log-format json --config /Users/dennis/Documents/projects/devcontainer-test/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true
[2023-07-21T07:18:52.920Z] Exit code 1

The "no matching manifest for linux/arm64/v8" is the thing that causes me to think that the platform argument is getting ignored, since AMD is specified and not ARM64.

The workaround I found is to pin the docker image using the sha256, this requires changing the dockerfile to the following:

FROM pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch1.13-cuda11.7.1@sha256:77a2b5267fa2a0d6877e59f7f6338879f51fac305eb963b3a3bca9d5c209f701

Doing so will cause the devcontainer to build properly.

Some additional info on VSCode:
version: 1.80.1 (Universal)
Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771
Date: 2023-07-12T17:20:23.298Z (1 wk ago)
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0

Dev containers version used:
v0.299.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.