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

devcontainer cli ignores docker context #5420

Open
navneetkarnani opened this issue Aug 6, 2021 · 7 comments
Open

devcontainer cli ignores docker context #5420

navneetkarnani opened this issue Aug 6, 2021 · 7 comments
Assignees
Labels
containers Issue in vscode-remote containers

Comments

@navneetkarnani
Copy link

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%
@github-actions github-actions bot added the containers Issue in vscode-remote containers label Aug 6, 2021
@stuartleeks
Copy link

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!

@navneetkarnani
Copy link
Author

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

@stuartleeks
Copy link

Thanks 👍

@Manouchehri
Copy link

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

@jflam
Copy link

jflam commented Oct 26, 2021

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?

@bhack
Copy link

bhack commented May 19, 2022

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

@raylu
Copy link

raylu commented May 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

6 participants