目錄
下載地址:
使用教程:
docker compose 查看版本
測試啟動 hello-world
報錯1 The system cannot find the file specified:
檢查 Docker Desktop 是否運行中
報錯2HF_ENDPOINT
1. 臨時解決方案(當前終端會話有效)
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
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:
-
通過系統設置永久添加環境變量:
-
搜索并打開?“編輯系統環境變量”。
-
點擊?“環境變量”?→ 在?“用戶變量”?或?“系統變量”?中新建:
-
變量名:
HF_ENDPOINT
,變量值:https://hf-mirror.com
-
變量名:
MACOS
,變量值:true
(僅需在 macOS 上設置)。
-
-