microsoft / microsoft/vscode-remote-release

howto configure docker context within workspace

Open
#6,576 6 comments 5 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Apr 8, 2022.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Asking this here because I suspect this is actually a bug or missing feature.

How might one configure a docker context with a particular workspace such that when using dev containers remotely the workspace always uses a configured context? I've attempted to use settings: {"docker.context": "my-context"} but it appears as though this setting is only used by the docker plugin, and not remote containers. I've also scoured the devcontainer reference for some way I specify an environment variable (DOCKER_CONTEXT) to be applied to the local environment before the remote container is created (thus leveraging the correct context), but this doesn't appears to be an option.

Dev containers work well on remote machines withdocker context use my-context but this is actually global setting for your docker client. vscode remote container should not require a global docker client setting when there are simple ways to specify a context at container creation time via the DOCKER_CONTEXT environment variable, or the --context global flag. Vscode appears to support neither of these methologies as best as I can tell.

Any thoughts or advice?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.