> 技术文档 > windows docker-01-desktop install windows10 + wls2 启用

windows docker-01-desktop install windows10 + wls2 启用


windows10 安装 docker

版本信息确认

需要区分 windows 是 amd64 还是 arm64

powershell 中执行:

> echo $env:PROCESSOR_ARCHITECTUREAMD64

下载

官方 https://www.docker.com/products/docker-desktop/ 下载

windows amd64

下载好了直接安装。

如何验证

powershell 中 docker version

$ docker versionClient: Version:  28.3.2 API version: 1.51 Go version: go1.24.5 Git commit: 578ccf6 Built: Wed Jul 9 16:12:31 2025 OS/Arch:  windows/amd64 Context:  desktop-linuxServer: Docker Desktop 4.43.2 (199162) Engine: Version: 28.3.2 API version: 1.51 (minimum version 1.24) Go version: go1.24.5 Git commit: e77ff99 Built: Wed Jul 9 16:13:55 2025 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.27 GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da runc: Version: 1.2.5 GitCommit: v1.2.5-0-g59923ef docker-init: Version: 0.19.0 GitCommit: de40ad0

入门例子

镜像运行

> docker run hello-worldUnable to find image \'hello-world:latest\' locallylatest: Pulling from library/hello-worlde6590344b1a5: Pull completeDigest: sha256:ec153840d1e635ac434fab5e377081f17e0e15afab27beb3f726c3265039cfffStatus: Downloaded newer image for hello-world:latestHello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/

查看

> docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUSPORTS NAMES2cb5aa698d2b hello-world \"/hello\" 30 seconds ago Exited (0) 29 seconds ago musing_villani

wsl2 中如何使用呢?

默认选择 WSL2,这里发现可以直接使用。

WSL 中执行:

$ docker versionClient: Version:  28.3.2 API version: 1.51 Go version: go1.24.5 Git commit: 578ccf6 Built: Wed Jul 9 16:12:50 2025 OS/Arch:  linux/amd64 Context:  defaultServer: Docker Desktop 4.43.2 (199162) Engine: Version: 28.3.2 API version: 1.51 (minimum version 1.24) Go version: go1.24.5 Git commit: e77ff99 Built: Wed Jul 9 16:13:55 2025 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.27 GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da runc: Version: 1.2.5 GitCommit: v1.2.5-0-g59923ef docker-init: Version: 0.19.0 GitCommit: de40ad0