1. Update the apt package index:
$ sudo apt-get update
  1. Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  1. Add Docker’s official GPG key:
<https://download.docker.com/linux/ubuntu/gpg>

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

$ sudo apt-key fingerprint 0EBFCD88

pub 4096R/0EBFCD88 2017–02–22Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88uid Docker Release (CE deb) docker@docker.comsub 4096R/F273FCD8 2017–02–22

  1. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.
<https://download.docker.com/linux/ubuntu>

Now we're ready to install Docker Community Edition

  1. Update the apt package index again
$ sudo apt-get update
  1. And install Docker CE
$ sudo apt-get install docker-ce

When that finishes, you'll end up having everything installed in Linux, but as I mentioned before, the Docker Engine does not run in WSL so if you write any command like docker images, you'll see a message like this one:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

No, it is not running and it'll never be, at least for now.