Vscode-docker: can't use non-default contexts

Created on 30 Jun 2020  ·  7Comments  ·  Source: microsoft/vscode-docker

Issue Type: Bug

I have contexts which work fine from the command line with docker context use but can't load any information in the docker extionsion with either ssh or tcp connection (both work fine from command line). TCP I get EPROTO SSLV3_ALERT_BAD_CERTIFICATE. Doesn't make any sense because this works fine on command line.

Extension version: 1.3.1
VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:17:14.222Z)
OS version: Darwin x64 19.5.0


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled|
|Load (avg)|3, 3, 3|
|Memory (System)|32.00GB (1.07GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|


duplicate

All 7 comments

The only way I can connect to my remote docker environment with vscode is by using eval $(docker-machine env envname) then launching vscode from the command line with code -n. So, basically it's just using the DOCKER_HOST configuration. I setup the context with the same ca,key,cert from the docker-machine environment variables.

Screen Shot 2020-06-30 at 12 25 05 PM

The extension does not use the CLI for anything in the tree view, for performance reasons. For TCP connections you'll need to use the docker.host / DOCKER_HOST + docker.certPath / DOCKER_CERT_PATH settings. We have not implemented docker context-based support for TCP + cert connections as it is extremely difficult to map the information from docker context to the options accepted by Dockerode.

SSH should be working as long as you have agent auth set up, this is documented here.

Ok, I switched back to ssh host for creating the docker context. Then after I ran ssh-add without any parameters to use the settings in ~/.ssh/id_rsa it works as expected. Thank you!

Glad it's working with SSH! Regarding the lack of TCP + Cert support with docker context, we have that tracked here: #2058

I guess we can resolve this one as a duplicate of that.

Glad it's working with SSH! Regarding the lack of TCP + Cert support with docker context, we have that tracked here: #2058

I guess we can resolve this one as a duplicate of that.

Ok, for what it's worth...

If I run eval $(docker-machine env myEnvName) then launch vscode with code -n to use the environment variables it is using the TCP configuration. And as a bonus it doesn't make any global changes to settings like docker context use seems to.

Thanks

Yes, I'd expect that. The way we apply settings is basically this--

  1. Try docker.dockerodeOptions, if that doesn't exist...
  2. Try docker.host plus the other environment-variable-settings, if that doesn't exist...
  3. Try DOCKER_HOST plus the other environment variables, if that doesn't exist...
  4. Try docker context (this _should_ always work, but if it doesn't...)
  5. Give up and instantiate Dockerode without arguments
Was this page helpful?
0 / 5 - 0 ratings

Related issues

thernstig picture thernstig  ·  3Comments

tecandrew picture tecandrew  ·  6Comments

SQLvariant picture SQLvariant  ·  3Comments

dschuessler picture dschuessler  ·  5Comments

gngchrs picture gngchrs  ·  3Comments