p1c2u/vscode-docker-compose

DOCKER_HOST configuration option

Closed this issue · 2 comments

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.

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

@yeckey 's fix was published. Closing.