Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
VS Code 1.83.1, using Dev Containers extension version 0.315.1.
Attempting to load a Dockerfile which pulls an image using the --platform flag will lead to a failure in starting the Dev Container if the requested image is not available in the host system architecture.
For example, the Microsoft Registry does not mantain Ubuntu 20.04 for ARM64 architecture, however, I specifically requested the AMD64 version in my Dockerfile, but still, the docker inspect command will fail because it will assume that I'm looking for the ARM64 version.
In order to work around the issue, one has to manually pull the image using docker pull as follows
It might be useful to add a configuration parameter in devcontainer.json that is used as additional arguments list for docker pull by the Dev Container extension.
Extension version: 0.315.1
VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:57:32.750Z)
OS version: Darwin arm64 23.0.0
Modes:
Remote OS version: Linux x64 6.1.55-0-virt
Type: Bug
VS Code 1.83.1, using Dev Containers extension version 0.315.1.
Attempting to load a Dockerfile which pulls an image using the
--platform
flag will lead to a failure in starting the Dev Container if the requested image is not available in the host system architecture.For example, the Microsoft Registry does not mantain Ubuntu 20.04 for ARM64 architecture, however, I specifically requested the AMD64 version in my Dockerfile, but still, the
docker inspect
command will fail because it will assume that I'm looking for the ARM64 version.In order to work around the issue, one has to manually pull the image using
docker pull
as followsand then try to start the dev container from VS Code. I assume this might be because of local caching of Docker images?
The configuration that I've used:
devcontainer.json
:and
Dockerfile
:As you can see in the full logs, the problem lies in the following lines:
It might be useful to add a configuration parameter in
devcontainer.json
that is used as additional arguments list fordocker pull
by the Dev Container extension.Logs:
Extension version: 0.315.1 VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:57:32.750Z) OS version: Darwin arm64 23.0.0 Modes: Remote OS version: Linux x64 6.1.55-0-virt
System Info
|Item|Value| |---|---| |CPUs|Apple M1 Pro (8 x 24)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|3, 3, 3| |Memory (System)|16.00GB (0.07GB free)| |Process Argv|| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Contenitore di sviluppo: DevContainer-Workspace @ colima| |OS|Linux x64 6.1.55-0-virt| |CPUs|unknown (4 x 0)| |Memory (System)|7.75GB (6.13GB free)| |VM|0%|