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 connect to Docker after opening a folder/workspace (Docker Toolbox) #964

Closed
wizcas opened this issue Jun 4, 2019 · 3 comments
Closed

Comments

@wizcas
Copy link

wizcas commented Jun 4, 2019

Environment:
Windows 10 Pro 1809 17763.503
Docker Toolbox with Docker 18.09.3

The extension on my machine works fine on a clean startup, i.e. in an empty workspace. It looks as below:

image

But once I open a folder or a workspace and the window reloaded, the connection won't establish anymore with error:

image

I have the DOCKER_HOST environment variable in my system setting as tcp://192.168.99.100:2376, and I tried to set docker.host to both tcp://192.168.99.100:2376 and 192.168.99.100:2376 (which was mentioned in another issue saying removing the protocol makes the extension works). None of them works.

Another weird thing is that, the start.sh script provided by Docker Toolbox can't work in VSCode terminal after loading folder/workspace as well, which works fine on startup. It shows an error that 'Docker Machine is not installed, which seems being caused by DOCKER_TOOLBOX_INSTALL_PATH not correctly read.

Is there any log or more information I can provide to figure out how this problem happens?

@wizcas
Copy link
Author

wizcas commented Jun 4, 2019

Here're more experiments which might lead to easier problem locating:

The extension cannot connect to docker after VS Code reloaded. So there is nothing to do with if there's a folder/workspace loaded, as long as VS Code doesn't reload after startup.

I tried to run code /foo/bar/work in terminal and the docker extension works super good with my the folder open. Then I selected Files->Open a folder->some other folder, VS Code reloads, and docker connection is down again as expected.

@ejizba
Copy link
Contributor

ejizba commented Jun 4, 2019

@wizcas there's a lot of discussion in VS Code about how and when process environment variables should be inherited. I'm guessing VS Code is properly inheriting DOCKER_HOST (or some other env var) when you open it the first time, but not after reloading the window. Here's one example issue: microsoft/vscode#15452 Suffice it to say I'm not entirely caught up on all of their design choices/reasoning in this area and you're welcome to poke around in their repo.

In terms of the "docker.host" setting - that is something we can control directly from this extension. We're aware there's issues here and we want to improve this. Take a look at this for an example: #216 (or any issue labeled with "DOCKER_HOST"). I don't have an easy workaround for you at the moment, but we're looking into it

@wizcas
Copy link
Author

wizcas commented Jun 5, 2019

@EricJizbaMSFT Thank you for you reply. Good to know the problems are spotted. Hopefully there will be a fix in not far future :)

@wizcas wizcas closed this as completed Jun 5, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants