Does the WSL from Windows 10 Spring update (2018) allows me to run docker on it? and why?

Daniel Santos

I heard that "Windows 10 Spring Update Bringing WSL Unix Sockets Support".

Before, I was unable to run docker service into a WSL due a socket error.

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

Does the new WLS spring update feature is enough to run docker on WSL?

Ramhound

Does the new WLS spring update feature is enough to run Docker on WSL?

Microsoft does not support running the Docker daemon (also known as the service) within the WSL instance.

We frequently get asked about running docker from within the Windows Subsystem for Linux (WSL). We don’t support running the docker daemon directly in WSL. But what you can do is call into the daemon running under Windows from WSL. What does this let you do? You can create docker files, build them, and run them in the daemon—Windows or Linux, depending on which runtime you have selected—all from the comfort of WSL.

[Cross Post] WSL Interoperability with Docker

The Docker daemon can't run under WSL as it doesn't implement the necessary kernel ABI's. If you're running Docker for Windows, you are probably connecting to the Hyper-V virtual machine that it manages.

Is Docker running within WSL or connecting back to Windows?

While the daemon cannot run within a WSL instance, you can use the Docker CLI, to connect to a Docker service running on your Windows installation.

In the general settings, you’ll want to expose the daemon without TLS. This step is necessary so that the daemon listens on a TCP endpoint. If you don’t do this then you won’t be able to connect from WSL.

enter image description here

We still need to install Docker inside WSL because it’ll give us access to the > Docker CLI. We just won’t bother starting the server.

The following instructions are for Ubuntu but with the 2017 fall update+ of Windows, WSL now supports a variety of distributions so if you happen to use something other than Ubuntu then follow the Docker installation guide for your distro from Docker’s installation docs.

This will install the edge channel, change ‘edge’ to ‘stable’ if you want. You may also want to update the Docker Compose version based on the latest release.

# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=edge
export DOCKER_COMPOSE_VERSION=1.21.0

# Update the apt package index.
sudo apt-get update

# Install packages to allow apt to use a repository over HTTPS.
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

# Add Docker's official GPG key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Verify the fingerprint.
sudo apt-key fingerprint 0EBFCD88

# Pick the release channel.
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   ${DOCKER_CHANNEL}"

# Update the apt package index.
sudo apt-get update

# Install the latest version of Docker CE.
sudo apt-get install -y docker-ce

# Allow your user to access the Docker CLI without needing root.
sudo usermod -aG docker $USER

# Install Docker Compose.
sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose &&
sudo chmod +x /usr/local/bin/docker-compose

First up, open a WSL terminal because we need to run a few commands.

Create and modify the new WSL configuration file:

sudo nano /etc/wsl.conf

# Now make it look like this and save the file when you're done:
[automount]
root = /
options = "metadata"

If you get an error the next time you start your WSL terminal don’t freak out. It’s a bug with 18.03 and you can easily fix it. Hit CTRL+Shift+ECS to open task manager, goto the “Services” tab, find the “LxssManager” service and restart it.

Setting Up Docker for Windows and WSL to Work Flawlessly

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Windows 10 Spring 업데이트 (2018)의 WSL을 사용하면 Docker를 실행할 수 있습니까? 그리고 왜?

분류에서Dev

Windows 10 docker update constantly updates

분류에서Dev

Windows + Docker + WSL2

분류에서Dev

Windows 10 does not wake up from LAN

분류에서Dev

Windows 10 April 2018 Update added an extra Language and I cannot remove it

분류에서Dev

How to get old Sticky Notes back after December 2018 update to Windows 10?

분류에서Dev

Windows 10 WSL의 Kali Linux

분류에서Dev

Windows 10 WSL의 Kali Linux

분류에서Dev

Stop Windows 10 calculator from asking me to rate it as an app

분류에서Dev

Why does devise me redirect me to /users instead of /users/edit when my account update fails?

분류에서Dev

How to run Windows 10 from an external hard drive?

분류에서Dev

Windows 10, cannot run any .exe from secondary drives

분류에서Dev

Run as different user from Windows 10 Start Menu

분류에서Dev

Why application does not run from SCREEN without delay?

분류에서Dev

Windows WSL2의 Docker 볼륨

분류에서Dev

Docker가 Windows 10 Home에서 WSL 2 배포판을 감지하지 못하는 이유는 무엇입니까?

분류에서Dev

Download Windows 10 Anniversary Update

분류에서Dev

What size does basic Bash/WSL subsystem on Windows occupy?

분류에서Dev

WSL ubuntu docker installation error. with `unix:///var/run/docker.sock.` message

분류에서Dev

Why this sql union do not run for me?

분류에서Dev

Does Windows 10 installer migrate your installed fonts from your previous version of windows?

분류에서Dev

Why does my icon font not work in IE10 on Windows 8 only?

분류에서Dev

Difference Between Windows Update and Windows 10 Update Assistant

분류에서Dev

Unable to update ebtables on WSL

분류에서Dev

Why does $<filename not run the cmd from `filename` but $`<filename` and $exec<filename works?

분류에서Dev

Spring Update Windows 10 ssh 클라이언트 역 조정이 작동하지 않음

분류에서Dev

Windows 10 Update-1511 제거

분류에서Dev

Windows 10 update 1511 failed and no longer offered

분류에서Dev

Verify Windows 10 Anniversary update ISO

Related 관련 기사

  1. 1

    Windows 10 Spring 업데이트 (2018)의 WSL을 사용하면 Docker를 실행할 수 있습니까? 그리고 왜?

  2. 2

    Windows 10 docker update constantly updates

  3. 3

    Windows + Docker + WSL2

  4. 4

    Windows 10 does not wake up from LAN

  5. 5

    Windows 10 April 2018 Update added an extra Language and I cannot remove it

  6. 6

    How to get old Sticky Notes back after December 2018 update to Windows 10?

  7. 7

    Windows 10 WSL의 Kali Linux

  8. 8

    Windows 10 WSL의 Kali Linux

  9. 9

    Stop Windows 10 calculator from asking me to rate it as an app

  10. 10

    Why does devise me redirect me to /users instead of /users/edit when my account update fails?

  11. 11

    How to run Windows 10 from an external hard drive?

  12. 12

    Windows 10, cannot run any .exe from secondary drives

  13. 13

    Run as different user from Windows 10 Start Menu

  14. 14

    Why application does not run from SCREEN without delay?

  15. 15

    Windows WSL2의 Docker 볼륨

  16. 16

    Docker가 Windows 10 Home에서 WSL 2 배포판을 감지하지 못하는 이유는 무엇입니까?

  17. 17

    Download Windows 10 Anniversary Update

  18. 18

    What size does basic Bash/WSL subsystem on Windows occupy?

  19. 19

    WSL ubuntu docker installation error. with `unix:///var/run/docker.sock.` message

  20. 20

    Why this sql union do not run for me?

  21. 21

    Does Windows 10 installer migrate your installed fonts from your previous version of windows?

  22. 22

    Why does my icon font not work in IE10 on Windows 8 only?

  23. 23

    Difference Between Windows Update and Windows 10 Update Assistant

  24. 24

    Unable to update ebtables on WSL

  25. 25

    Why does $<filename not run the cmd from `filename` but $`<filename` and $exec<filename works?

  26. 26

    Spring Update Windows 10 ssh 클라이언트 역 조정이 작동하지 않음

  27. 27

    Windows 10 Update-1511 제거

  28. 28

    Windows 10 update 1511 failed and no longer offered

  29. 29

    Verify Windows 10 Anniversary update ISO

뜨겁다태그

보관