How to install Docker on Windows Linux Subsystem (WSL)

Install Docker on WSL, if you follow the official website process https://docs.docker.com/install/linux/docker-ce/ubuntu/ to operate, although it can be installed, but then when you run sudo docker run hello-world There will be problems. After researching on the internet, the following methods are summarized:

  1. A system administrator is required to run WSL. Because my computer is restricted by the company’s IT policy, I can’t right-click on the Ubuntu APP and choose to run as system administrator in More, so I need to run powershell as system administrator first, and then run start-process ubuntu1804.exe
  2. Download an older version of Docker, curl -O https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_17.09.0~ce-0~debian_amd64.deb, Then install sudo dpkg -i docker-ce_17.09.0\~ce-0\~debian_amd64.deb. Then run sudo cgroupfs-mount, sudo service docker start. If docker fails to start, it may be a problem with iptables, because WSL does not have UFW, you can run sudo dockerd --iptables=false to disable it. Then you can run sudo docker run hello-world normally

If the Docker port cannot be accessed from the external network after Docker is started, you can refer to the following article to modify it.

https://blog.csdn.net/kakeu/article/details/102964585

Guess you like

Origin blog.csdn.net/gzroy/article/details/104071089