赞
踩
Docker Desktop WSL 2 backend on Windows | Docker Documentation
Before you turn on the Docker Desktop WSL 2, ensure you have:
Select the Use WSL 2 based engine check box.
If you have installed Docker Desktop on a system that supports WSL 2, this option is enabled by default.
Now docker
commands work from Windows using the new WSL 2 engine.
WSL 2 adds support for “Linux distros” to Windows, where each distro behaves like a VM except they all run on top of a single shared Linux kernel.
Docker Desktop does not require any particular Linux distros to be installed. The docker
CLI and UI all work fine from Windows without any additional Linux distros. However for the best developer experience, we recommend installing at least one additional distro and enabling Docker support by:
Ensure the distribution runs in WSL 2 mode. WSL can run distributions in both v1 or v2 mode.
To check the WSL mode, run:
$ wsl.exe -l -v
To upgrade your existing Linux distro to v2, run:
$ wsl.exe --set-version (distro name) 2
To set v2 as the default version for future installations, run:
$ wsl.exe --set-default-version 2
When Docker Desktop starts, go to Settings > Resources > WSL Integration.
The Docker-WSL integration is enabled on your default WSL distribution. To change your default WSL distro, run wsl --set-default <distro name>
For example, to set Ubuntu as your default WSL distro, run:
$ wsl --set-default ubuntu
Optionally, select any additional distributions you would like to enable the Docker-WSL integration on.
Note
The Docker-WSL integration components running in your distro depend on glibc. This can cause issues when running musl-based distros such as Alpine Linux. Alpine users can use the alpine-pkg-glibc package to deploy glibc alongside musl to run the integration.
Select Apply & Restart.
Note
Docker Desktop installs two special-purpose internal Linux distros
docker-desktop
anddocker-desktop-data
. The first (docker-desktop
) is used to run the Docker engine (dockerd
) while the second (docker-desktop-data
) stores containers and images. Neither can be used for general development.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。