Skip to content

devcontainer cli ignores docker context #5420

Open

Description

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%

Activity

  1. stuartleeks commented on Aug 16, 2021

    @stuartleeks

    Hi Navneet Karnaani (@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!

  2. navneetkarnani commented on Aug 16, 2021

    @navneetkarnani
    Author

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

  3. stuartleeks commented on Aug 16, 2021

    @stuartleeks

    Thanks 👍

  4. Manouchehri commented on Aug 27, 2021

    @Manouchehri

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

  5. jflam commented on Oct 26, 2021

    @jflam

    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 Navneet Karnaani (@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?
  6. bhack commented on May 19, 2022

    @bhack

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

  7. raylu commented on May 14, 2024

    @raylu

    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

  8. anthonylau commented on Dec 11, 2025

    @anthonylau

    still an issue with devcontainer cli version 0.80.1

    code . -> reopen in container works but not devcontainer open

    it use default docker context unix:///var/run/docker.sock while it doesn't exists

  9. nsbk commented on Feb 25, 2026

    @nsbk

    This issue is still happening in version 0.80.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersIssue in vscode-remote containers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions