docker 安装windows

目录

下载地址:

使用教程:

[docker compose 查看版本](#docker compose 查看版本)

[测试启动 hello-world](#测试启动 hello-world)

[报错1 The system cannot find the file specified:](#报错1 The system cannot find the file specified:)

[检查 Docker Desktop 是否运行中](#检查 Docker Desktop 是否运行中)

报错2HF_ENDPOINT

[1. 临时解决方案(当前终端会话有效)](#1. 临时解决方案(当前终端会话有效))

[2. 永久解决方案](#2. 永久解决方案)

Linux/macOS:

Windows:


下载地址:

Get Started | Docker

使用教程:

【超详细:从头开始的windows系统下的docker安装,在docker中建立ubuntu系统并配置pytorch深度学习环境,实现windows系统下访问ubuntu中的jupyterlab】_docker windows-CSDN博客

在cmd或者PowerShell下执行命令验证 Docker 是否正常运行:

复制代码
docker -v

docker compose 查看版本

复制代码
docker compose version

测试启动 hello-world

复制代码
docker run hello-world

ok 回答

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/

报错1 The system cannot find the file specified:

error during connect: Head "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/_ping": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.

解决方法:

检查 Docker Desktop 是否运行中
  • 打开"开始菜单",搜索 Docker Desktop 并启动它。

  • 看它是否正常运行,不报错。

报错2HF_ENDPOINT

time="2025-07-12T01:39:37+08:00" level=warning msg="The \"HF_ENDPOINT\" variable is not set. Defaulting to a blank string." time="2025-07-12T01:39:37+08:00" level=warning msg="The \"MACOS\" variable is not set. Defaulting to a blank string." 怎么解决

解决方法:

1. 临时解决方案(当前终端会话有效)

在终端中直接运行以下命令(Linux/macOS):

复制代码
# 设置 Hugging Face 的镜像端点(如果需要国内加速)
export HF_ENDPOINT="https://hf-mirror.com"

# 如果是 macOS 系统,可以设置(通常不需要)
export MACOS="true"  # 或者根据程序要求设置其他值

Windows(CMD/PowerShell):

cmd

bash 复制代码
set HF_ENDPOINT=https://hf-mirror.com
set MACOS=true
复制代码
# PowerShell
$env:HF_ENDPOINT = "https://hf-mirror.com"
$env:MACOS = "true"

2. 永久解决方案

将变量添加到系统环境配置文件中,避免每次重启终端后重新设置。

Linux/macOS
  • 编辑 ~/.bashrc~/.zshrc(根据你的 shell):

    复制代码
    echo 'export HF_ENDPOINT="https://hf-mirror.com"' >> ~/.bashrc
    echo 'export MACOS="true"' >> ~/.bashrc  # 如果是 macOS 系统
    source ~/.bashrc  # 立即生效
Windows
  • 通过系统设置永久添加环境变量:

    1. 搜索并打开 "编辑系统环境变量"

    2. 点击 "环境变量" → 在 "用户变量""系统变量" 中新建:

      • 变量名:HF_ENDPOINT,变量值:https://hf-mirror.com

      • 变量名:MACOS,变量值:true(仅需在 macOS 上设置)。

相关推荐
sssammmm4 分钟前
AI入门学习--如何写好prompt?
人工智能·学习·prompt
阿群今天学习了吗18 分钟前
“鱼书”深度学习进阶笔记(3)第四章
人工智能·笔记·python·深度学习·算法
神齐的小马19 分钟前
机器学习 [白板推导](十)[马尔可夫链蒙特卡洛法]
人工智能·机器学习·概率论
白-胖-子32 分钟前
深度剖析主流AI大模型的编程语言与架构选择:行业实践与技术细节解读
人工智能·架构
AI模块工坊36 分钟前
IEEE 2025 | 重磅开源!SLAM框架用“法向量+LRU缓存”,将三维重建效率飙升72%!
人工智能·深度学习·神经网络·机器学习·计算机视觉
nbsaas-boot36 分钟前
用生成器守住架构,用 AI 放大效率:一套可落地的 AI 编程方法论
人工智能·架构
文弱_书生1 小时前
为什么神经网络的权重矩阵具有低秩特性?如何理解和解释?
人工智能·神经网络·矩阵
Bar_artist1 小时前
微软推出革命性AI安全工具Project IRE,重塑网络安全防御新范式
人工智能·安全·microsoft
cver1232 小时前
人脸情绪检测数据集-9,400 张图片 智能客服系统 在线教育平台 心理健康监测 人机交互优化 市场研究与广告 安全监控系统
人工智能·安全·yolo·计算机视觉·目标跟踪·机器人·人机交互
技术老金2 小时前
LangGraph入门与避坑指南:从ReAct到复杂流程编排
人工智能·python