p1c2u / vscode-docker-compose

Docker Compose Extension for Visual Studio Code
MIT License
18 stars 8 forks source link

DOCKER_HOST configuration option #32

Closed dmlb2000 closed 5 years ago

dmlb2000 commented 5 years ago

I've tried setting the environment variable DOCKER_HOST in about 3 or 4 different places and docker-compose extension won't honor it. Could we just get a configuration option to set DOCKER_HOST (or just use the docker extensions config) to specify where the docker host is?

I'm running Win10 with WSL my docker host is locally available but only through tcp://127.0.0.1:2375 by default docker likes to try unix sockets or the windows npipe to talk with docker. I've got DOCKER_HOST set in my user environment and it shows up in both Powershell and Bash. I can even start a terminal within VSCode and DOCKER_HOST is there as well, still docker-compose can't connect to the local docker host, it still tries using http+docker://localhost.

yeckey commented 5 years ago

I was running into the same issue with my setup and traced back the missing DOCKER_HOST to the CommandExecutor. It seems the parent's environment would not be passed down to the spawned child processes calling docker-compose. I created pull request #33 to fix it by merging in the parent's process.env. This should fix the issue for Win10/WSL setups.

p1c2u commented 5 years ago

@yeckey 's fix was published. Closing.