wsl登录harbor dial tcp: lookup xxx.xxx.xxx: no such host

root@thinkpade14r7:~/harbor# docker login registry.cluster.local

Username: admin

Password:

Error response from daemon: Get "https://registry.cluster.local/v2/": dialing registry.cluster.local:443 container via direct connection because has no HTTPS proxy: connecting to registry.cluster.local:443: dial tcp: lookup registry.cluster.local: no such host

在wsl的/etc/hosts中配置了域名解析,没用,要去windows的C:\Windows\System32\drivers\etc\hosts文件中配置才行,坑爹。

配好后把harbor的证书copy到wsl的docker域名配置里/etc/docker/certs.d/registry.cluster.local/ca.crt

bash 复制代码
root@thinkpade14r7:~/harbor# ls
LICENSE  certs  common  common.sh  data  docker-compose.yml  harbor.v2.13.0.tar.gz  harbor.yml  harbor.yml.tmpl  install.sh  prepare
root@thinkpade14r7:~/harbor# cp certs/
ca.crt             ca.key             ca.srl             cluster.local.crt  cluster.local.csr  cluster.local.key  v3.ext
root@thinkpade14r7:~/harbor# cp certs/cluster.local.crt  /etc/docker/certs.d/registry.cluster.local/ca.crt
相关推荐
谢娘蓝桥2 天前
wsl2 windows 安装
wsl
sz4972385993 天前
WSL2+VSCode搭建ESP-IDF 开发环境
ide·vscode·编辑器·esp32·wsl
*星星之火*3 天前
【AI工具篇】Windows 安装 WSL 全攻略:wsl --install 一键部署 + VSCode 搭配使用好处详解
windows·vscode·wsl
吴烦恼的博客8 天前
WSL迁移指南
ubuntu·wsl·系统移植
Irene199112 天前
前端开发中,WSL和本地开发的区别(本地项目,PowerShell和Bash均可执行npm命令,推荐使用 PowerShell)
wsl·本地开发
cuckooman14 天前
如何升级wsl1到wsl2
wsl·wsl2
无巧不成书021814 天前
保姆级教程:解决DISM错误0x800f0915,成功开启虚拟机平台(2026年最新版)
wsl·windows11·系统修复·dism错误·虚拟机平台
Irene199114 天前
Cursor/VSCode 连接 WSL 频繁掉线问题完整排查记录(AI总结版)
编辑器·wsl
goto199715 天前
Ubuntu调整路径--从C盘调整到D盘
ubuntu·wsl·c盘·d盘
comedate16 天前
【WSL】【OpenClaw】WSL 中配置 SearXNG 指南
wsl·searxng·openclaw·搜索引擎部署