-
Notifications
You must be signed in to change notification settings - Fork 521
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
Add a docker.context setting for setting DOCKER_CONTEXT similar to docker.host #2264
Comments
It doesn't allow setting context per project because the current context is set by the docker context use ... . command The value is stored in the docker.config file in the User's profile folder. Indeed, it is possible to create as many contexts as needed, but the current context is used by all kinds and instances of docker tools used by the user. It ensures consistency rather than flexibility when development, deployment, and management of complex applications. Docker context also helps to store sensitive user-level information in a secure manner and transfer it from development to testing and deployment environment. It is very useful when the user works in a multitenant environment like the cloud-based development pipelines - nothing is shared among tenants. |
There is definitely a matter of taste and preference here. The global current context mechanism is convenient in some scenarios but can be inconvenient in others, such as wanting to have different windows/terminals that use different contexts at the same time. Docker provides an environment variable and CLI flag to use a non-default/current context. kubectl only has a CLI flag which has often been annoying. |
I think such a setting has equal value to |
@segevfiner I thought of one existing capability of VSCode that might help in your scenario. VSCode has some settings ( |
Running into some difficulties with implementation. Dockerode is completely unaware of contexts so it will use whatever value we give it as the host. Since each extension host has its own Dockerode object, multiple windows of VSCode can talk to different hosts--no problem there. With the new Docker SDK though, there's no equivalent I'm aware of to the I opened docker/node-sdk#42 to get something like a |
This is now fixed in Docker extension version 1.7.0. |
Docker context is a fully client-side feature and requires only one docker context use command per workspace switch |
Add a
docker.context
setting for settingDOCKER_CONTEXT
similar todocker.host
for settingDOCKER_HOST
. This will allow using docker contexts per window or project rather than globally.This should probably also be supported by the Remote - Containers extension.
The text was updated successfully, but these errors were encountered: