一、安装步骤
Windows Docker 安装 | 菜鸟教程
二、本地环境
操作系统:windows11
网络环境:科学上网
三、资源下载
稍后放到网盘后给出下载链接
四、版本信息
$ docker version
Client:Version: 26.1.4API version: 1.45Go version: go1.21.11Git commit: 5650f9bBuilt: Wed Jun 5 11:29:54 2024OS/Arch: windows/amd64Context: desktop-linuxServer: Docker Desktop 4.31.1 (153621)Engine:Version: 26.1.4API version: 1.45 (minimum version 1.24)Go version: go1.21.11Git commit: de5c9cfBuilt: Wed Jun 5 11:29:22 2024OS/Arch: linux/amd64Experimental: falsecontainerd:Version: 1.6.33GitCommit: d2d58213f83a351ca8f528a95fbd145f5654e957runc:Version: 1.1.12GitCommit: v1.1.12-0-g51d5e94docker-init:Version: 0.19.0GitCommit: de40ad0
五、遇到的问题
1、docker run hello-world身份验证错误
问题现象:
$: docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Head "https://registry-1.docker.io/v2/library/hello-world/manifests/latest": unauthorized: incorrect username or password.
See 'docker run --help'.
问题原因:
Docker hello-world:身份验证错误-腾讯云开发者社区-腾讯云
解决方案:
执行docker login 重新登陆后再次执行docker run hello-world,运行成功
2、解决镜像获取失败问题
问题现象:
$ docker run -i -t ubuntu:15.10 /bin/bash
Unable to find image 'ubuntu:15.10' locally
15.10: Pulling from library/ubuntu
7dcf5a444392: Retrying in 1 second
759aa75f3cee: Retrying in 1 second
3fa871dc8a2b: Retrying in 1 second
224c42ae46e7: Waiting
docker: error pulling image configuration: download failed after attempts=6: dialing production.cloudflare.docker.com:443 container via direct connection because has no HTTPS proxy: connecting to 108.160.165.212:443: dial tcp 108.160.165.212:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
See 'docker run --help'.
问题原因:梯子坏了
解决方案:切换为阿里云镜像
针对安装了Docker for Windows的用户,您可以参考以下配置步骤:
在系统右下角托盘图标内右键菜单选择 Settings,打开配置窗口后左侧导航菜单选择 Docker Daemon。编辑窗口内的JSON串,填写下方加速器地址:
{"registry-mirrors": ["https://{你的ID}.mirror.aliyuncs.com"]
}
编辑完成后点击 Apply 保存按钮,等待Docker重启并应用配置的镜像加速器。