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

can't use non-default contexts #2120

Closed
calbot opened this issue Jun 30, 2020 · 7 comments
Closed

can't use non-default contexts #2120

calbot opened this issue Jun 30, 2020 · 7 comments

Comments

@calbot
Copy link

calbot commented Jun 30, 2020

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%
@calbot
Copy link
Author

calbot commented Jun 30, 2020

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.

@calbot
Copy link
Author

calbot commented Jun 30, 2020

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

@bwateratmsft
Copy link
Contributor

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.

@calbot
Copy link
Author

calbot commented Jun 30, 2020

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!

@bwateratmsft
Copy link
Contributor

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.

@calbot
Copy link
Author

calbot commented Jun 30, 2020

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

@bwateratmsft
Copy link
Contributor

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

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants