Skip to content

Instantly share code, notes, and snippets.

@riccardo1980
Last active March 18, 2021 09:30
Show Gist options
  • Save riccardo1980/7e9b21dcb5078c7d53883a5b22ce717d to your computer and use it in GitHub Desktop.
Save riccardo1980/7e9b21dcb5078c7d53883a5b22ce717d to your computer and use it in GitHub Desktop.

HowTo use Windows Docker service in WSL commandline and remote WSL VSCode

WARNING: Since wsl2 introduction, this How-To is outdated

Installation

Windows

Install Docker Desktop for Windows https://hub.docker.com/editions/community/docker-ce-desktop-windows

Linux

See https://docs.docker.com/install/linux/docker-ce/debian/

Unsecured connection

Expose Windows docker Daemon: Docker -> Settings -> General

Open a shel in WSL and add configuration on .bashrc: echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc

Reload and check whether vscode docker plugin is able to interact with Docker Daemon

TLS Secure Connection

https://dontpaniclabs.com/blog/post/2017/11/16/securing-the-docker-api-on-windows/ https://artisticcheese.wordpress.com/2017/06/10/using-pure-powershell-to-generate-tls-certificates-for-docker-daemon-running-on-windows/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment