Skip to content

Instantly share code, notes, and snippets.

@bluecloudy
Last active March 12, 2024 01:22
Show Gist options
  • Select an option

  • Save bluecloudy/3aad877e58fbc18126b9f8479469af62 to your computer and use it in GitHub Desktop.

Select an option

Save bluecloudy/3aad877e58fbc18126b9f8479469af62 to your computer and use it in GitHub Desktop.
WSL: Docker for WSL

Ubuntu

WSL: Docker for WSL

  1. Install docker

  2. Docker daemon

    • sudo nano /etc/docker/daemon.json { "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }
  3. Config VSCode

    • "docker.host": "localhost:2375"
  4. Fix container network problem

    • sudo nano /etc/resolv.conf
    • remove # This file was automatically generated by WSL. To stop automatic generation of this file, remove this line
    • add nameserver 8.8.8.8 nameserver 8.8.4.4
@bluecloudy
Copy link
Author

bluecloudy commented Apr 18, 2019

WSL still has many problem with network (iptables NAT): microsoft/WSL#767
Consider to use Docker for Window: https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly

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