赞
踩
Docker Desktop是一个在Windows和macOS上运行的应用程序,能够让开发者使用Docker容器技术。它包括了Docker Engine、Docker CLI客户端、Docker Compose、Docker Content Trust、Kubernetes和Credential Helper等。下面是一篇详细的指南,帮助你在Windows上安装Docker Desktop。这是个好东西,作为开发者,电脑上可能需要允许各种软件用来做不同需求的程序,Docker desktop的出现,将对机器资源利用的极致压榨从linux带到了windows,对程序员的日常工作有很大的帮助。
在安装Docker Desktop之前,请确保你的系统满足以下要求:
Docker Desktop Installer.exe
。控制面板—程序—程序和功能—启动或关闭Windows功能 中 勾选【Hyper-V】和【容器】选项
重启电脑。
启动Docker Desktop后,你会看到Docker的鲸鱼图标出现在系统托盘中。当鼠标悬浮在鲸鱼图标变成绿色时,表示Docker已经成功启动并运行。
打开命令提示符或PowerShell,输入以下命令来验证Docker安装是否成功:
>docker --version
你应该会看到Docker的版本信息,类似于:
>Docker version 25.0.3, build 4debf41
按照程序界惯例,每安装新软件,都要来一次hello word:
- >docker run hello-world
-
- Unable to find image 'hello-world:latest' locally
- latest: Pulling from library/hello-world
- c1ec31eb5944: Pull complete
- Digest: sha256:266b191e926f65542fa8daaec01a192c4d292bff79426f47300a046e1bc576fd
- Status: Downloaded newer image for hello-world:latest
-
- Hello 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 bash
-
- Share 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 Desktop默认使用WSL 2(Windows Subsystem for Linux 2)作为后端。如果你的系统支持并且你希望使用WSL 2,可以按照以下步骤进行配置:
启用Windows的Linux子系统:
欢迎关注我们人工智能在新媒体领域应用的公众号。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。