Skip to content

Instantly share code, notes, and snippets.

@ChristophShyper
Last active January 10, 2023 20:36

Revisions

  1. ChristophShyper revised this gist May 6, 2020. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions wsl2-docker.md
    Original file line number Diff line number Diff line change
    @@ -17,15 +17,17 @@ wsl --set-default-version 2
    For example [Ubuntu 18.04 LTS](https://www.microsoft.com/en-us/p/ubuntu-1804-lts/9n9tngvndl3q?activetab=pivot:overviewtab)

    ## Win / Optional: Install X11 server
    For example [VcXsrv](https://sourceforge.net/projects/vcxsrv/)
    For example [VcXsrv](https://sourceforge.net/projects/vcxsrv/).

    ## WSL / Optional: Prepare for X11 on Windows
    Add to `~/.bashrc` (provide IP of your Windows host):
    ```
    export DISPLAY=192.168.1.11:0
    ```

    ## Win / Install Docker Destop Edge
    Download version [2.1.6.0](https://download.docker.com/win/edge/40807/Docker%20Desktop%20Installer.exe) or [search for later](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)
    Enable `Enable the experimental WSL 2 based engine` on `General` tab.
    ## Win / Install Docker Desktop Edge
    Download version [2.1.6.0](https://download.docker.com/win/edge/40807/Docker%20Desktop%20Installer.exe) or [search for latest](https://docs.docker.com/docker-for-windows/wsl-tech-preview/).<br>
    Enable `Enable the experimental WSL 2 based engine` on `General` tab.<br>
    Enable your WSL distro on `Resources` tab.

    ## WSL / Install Docker
  2. ChristophShyper revised this gist May 6, 2020. No changes.
  3. ChristophShyper revised this gist May 6, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wsl2-docker.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ Bash:
    ```
    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install docker-ce
  4. ChristophShyper revised this gist Mar 12, 2020. No changes.
  5. ChristophShyper revised this gist Dec 3, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions wsl2-docker.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ export DISPLAY=192.168.1.11:0
    ```

    ## Win / Install Docker Destop Edge
    Download version [2.1.6.0](https://download.docker.com/win/edge/40807/Docker%20Desktop%20Installer.exe) or [serch for later](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)
    Download version [2.1.6.0](https://download.docker.com/win/edge/40807/Docker%20Desktop%20Installer.exe) or [search for later](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)
    Enable `Enable the experimental WSL 2 based engine` on `General` tab.
    Enable your WSL distro on `Resources` tab.

    @@ -38,9 +38,9 @@ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubun
    sudo apt-get update
    sudo apt-get install docker-ce
    sudo gpasswd -a $USER docker
    sudo service docker start
    sudo mkdir /sys/fs/cgroup/systemd
    sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
    sudo service docker start
    ```

    ## WSL / Verify
  6. ChristophShyper created this gist Nov 26, 2019.
    51 changes: 51 additions & 0 deletions wsl2-docker.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    # On Windows 10 build 18917 or higher

    ## Win / Enable WSL and VMP
    PowerShell:
    ```
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    ```

    ## Win / Set WSL 2 as default
    PowerShell:
    ```
    wsl --set-default-version 2
    ```

    ## Win / Install Linux distro from Microsoft Store
    For example [Ubuntu 18.04 LTS](https://www.microsoft.com/en-us/p/ubuntu-1804-lts/9n9tngvndl3q?activetab=pivot:overviewtab)

    ## Win / Optional: Install X11 server
    For example [VcXsrv](https://sourceforge.net/projects/vcxsrv/)
    Add to `~/.bashrc` (provide IP of your Windows host):
    ```
    export DISPLAY=192.168.1.11:0
    ```

    ## Win / Install Docker Destop Edge
    Download version [2.1.6.0](https://download.docker.com/win/edge/40807/Docker%20Desktop%20Installer.exe) or [serch for later](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)
    Enable `Enable the experimental WSL 2 based engine` on `General` tab.
    Enable your WSL distro on `Resources` tab.

    ## WSL / Install Docker
    Bash:
    ```
    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install docker-ce
    sudo gpasswd -a $USER docker
    sudo service docker start
    sudo mkdir /sys/fs/cgroup/systemd
    sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
    ```

    ## WSL / Verify
    Bash:
    ```
    docker info
    docker run hello-world
    ```