vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

devcontainer cli ignores docker context

Open navneetkarnani opened this issue 4 years ago • 7 comments

Issue Type: Bug

devcontainer open does not honor the docker context on the commandline. While, use code . and then open in container it does.

Extension version: 0.191.0 VS Code version: Code 1.59.0 (379476f0e13988d90fab105c5c19e7abc8b1dea8, 2021-08-04T23:14:40.191Z) OS version: Darwin x64 20.6.0 Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz (4 x 1600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 50, 32, 18
Memory (System) 16.00GB (1.48GB free)
Process Argv .
Screen Reader no
VM 0%

navneetkarnani avatar Aug 06 '21 08:08 navneetkarnani

Hi @navneetkarnani. I have a quick question to ensure I understand your scenario correctly: when setting the docker context, how are you doing that? Via DOCKER_CONTEXT environment variable, or the docker context use CLI command? Thanks!

stuartleeks avatar Aug 16 '21 09:08 stuartleeks

Using 'docker context' which makes it a persistent setting.

navneetkarnani avatar Aug 16 '21 09:08 navneetkarnani

Thanks 👍

stuartleeks avatar Aug 16 '21 09:08 stuartleeks

This is a bit off-topic, but how do you handle bind mounts with a remote docker context in VS Code Remote?

Manouchehri avatar Aug 27 '21 22:08 Manouchehri

I think I have the same problem. I set the docker context via the docker.host property in a custom .vscode/settings.json file in the repo (I want the container to launch using Docker on a remote machine). When I open the directory using code . everything works fine once I reopen in the container. However, if I try to open it using devcontainer open, it tries to build the image locally, ignoring .vscode/settings.json.

A few questions:

  1. Is setting docker.host the correct way to do this - it seems to work?
  2. Is this the same issue as @navneetkarnani?
  3. Is there a timeline for this fix? I have a workaround for now, but it forces the user to always reload which is annoying.
  4. Will you have an option in the future to not require a local Docker install if the user wants to use remote containers only?

jflam avatar Oct 26 '21 21:10 jflam

This issue is still reproducible in code-insider. Any update?

bhack avatar May 19 '22 19:05 bhack

this is pretty painful for switching contexts right now. if you have docker desktop for macOS installed ("desktop-linux") and you try to migrate to orbstack, even setting docker context use ... results in all your docker commands operating on the orbstack context but devcontainers continuing to try to use desktop-linux

raylu avatar May 14 '24 22:05 raylu