惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
The GitHub Blog
The GitHub Blog
美团技术团队
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
Attack and Defense Labs
Attack and Defense Labs
G
Google Developers Blog
I
InfoQ
博客园 - 司徒正美
T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
S
Security Affairs
M
MIT News - Artificial intelligence
Simon Willison's Weblog
Simon Willison's Weblog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Tailwind CSS Blog
量子位
Vercel News
Vercel News
月光博客
月光博客
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 最新话题
F
Full Disclosure
The Hacker News
The Hacker News
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog
A
Arctic Wolf
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Forbes - Security
Forbes - Security
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
GbyAI
GbyAI
B
Blog RSS Feed
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs

Docker

Homelab 部署的服务用 latest 还是固定版本? - V2EX 有啥基于 docker 的类似于微信文件传输助手的东西吗? 有没有什么比较优雅且轻量化的 web 端微信解决方案? V2EX 请问 OrbStack 界面下不能修改参数吗? - V2EX V2EX mac 上面的 docker desktop 都更新些啥啊 - V2EX 阿里云轻量服务器中拉取 Docker 镜像问题 - V2EX 现在大家如何拉取 Docker 镜像? - V2EX 轻量级 OCR 文字识别服务 netnr/liteocr - V2EX 现在官方 docker 拉镜像必须 TUN+全局了吗 - V2EX 请教一下佬们,在使用 1panel 的情况下,有没有必要再部署 Traefik 作为 Docker 统一网关? - V2EX 创建 docker 镜像时为了防止结束,运行 sleep infinity 和 tail -f /dev/null 哪个更好 - V2EX 2025 年了,大家公司的服务器用的是 debian 还是 ubuntu 呀 - V2EX Watchtower 停止维护 - V2EX NAS 上部署自制 docker 程序发生网络连接相关问题 - V2EX 请问下现代的 docker 版本,是无法再使用 centos6.8 这类容器了么? - V2EX 现在是不推荐使用 阿里云或腾讯云或高校的 dokcer 镜像源吗? 为什么? 一直挂梯子用 docker, 不了解现在的情况了 - V2EX 私有化部署了一套公司的系统,如何有效保护容器里面的文件不被客户拿到 - V2EX Docker 29.1 不能解析外部 dns - V2EX 求助 docker 中安装 portainer 不能连接 docker.sock - V2EX docker ps 显示正在运行,但是服务已经 down 了 - V2EX 公司禁用 Docker - V2EX V2EX macos 下使用 orbstack 如何才能不挂载目录? - V2EX Docker 镜像的 UID、GID 管理都这么阴间的么? - V2EX 请教一个 Docker/Traefik 的网路问题 - V2EX docker compose 在生产上用的多吗,小规模 - V2EX 2025 年了,感觉 podman 已经比 docker 好用太多了,就差一个杀手级的 GUI 配置了 - V2EX ttl.sh 被阿里做掉了,怎么办? - V2EX 万物皆 docker 部署,真的有必要吗? - V2EX 只做镜像 harbor nexus 两个软件对比选择哪个呢? - V2EX 在容器里运行 VPN,如何接管其他容器的流量作为默认出口? - V2EX docker 重磅安全漏洞 - V2EX 请教一个关于 docker 间的通信问题 - V2EX [求助] Debian12 修改 docker 的 daemon.json 文件后不生效 - V2EX docker compose 那个内部 DNS 到底是怎么工作的 - V2EX 小白求助, Docker 报错 132 是什么问题呢? - V2EX 自己搭建一个 docker 镜像站 - V2EX 怎么对 docker 的容器限速 - V2EX V2EX 请教大家一个关于 docker 网络的问题 - V2EX 为什么国内镜像源都不更新国外的镜像? - V2EX 请问 docker 镜像是否存在版本兼容问题? - V2EX 有没有可行的 reproducible 容器环境方案? - V2EX 不安装 docker 有办法直接下载镜像 tar 包吗? - V2EX 在国内服务器上使用 sing-box 方便的拉取 docker 镜像 - V2EX 有没有带权限的 docker 管理工具 - V2EX Openp2p 远程访问飞牛 NAS 内应用不成功,请有经验的老铁指教。 - V2EX 有没有让 docker 容器休眠的方法 - V2EX 生产环境部署疑问 运行 docker 容器需要指定一个版本吗 - V2EX
WSL 中无法访问 registry-1.docker.io/v2/,没法用 docker 拉取 image,试了很多方法都不行,累了 - V2EX
Meditation · 2025-07-20 · via Docker

这是一个创建于 329 天前的主题,其中的信息可能已经有所发展或是发生改变。

在 windows11 中安装了 WSL 2 ( Ubuntu ),安装了 docker 后,死活没法 pull image 。

docker-compose up
Pulling db (mysql:8.0)...
ERROR: Get "https://registry-1.docker.io/v2/": context deadline exceeded

尝试过的方法:

  1. 修改 /etc/docker/daemon.json ,添加阿里云镜像源
  2. 使用 ipv4
  3. 修改 /etc/resolv.conf ,使用 nameserver 8.8.8.8 nameserver 1.1.1.1

麻了,有没大佬知道应该怎么解决这个问题呀。

第 1 条附言  ·  2025 年 7 月 22 日

最终在众多留言大佬的帮助下,终于解决了这个问题。

在 WSL 的 ~/.bashrc 加入如下内容:

export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"

刷新 source ~/.bashrc

编辑 /etc/resolv.conf,使用如下:

nameserver 8.8.8.8

另外,宿主机(我的window11)使用 clash verge,开启虚拟网卡模式,用的是默认配置。(一开始我还不懂网友们说的 TUN 是什么,直到点击虚拟网卡模式的设置,才看到)

很坑的是,这个 /etc/resolv.conf 每次重启 WSL 后又会恢复默认配置……

8820670

2

8820670      2025 年 7 月 20 日 via Android

op 是很久没有用 docker 了吗 dockerhub 以及大的镜像站都被墙很久了

Meditation

3

Meditation      2025 年 7 月 20 日

@dcsuibian 还是不行,不知道是不是我配置的有问题,我是在自己个人电脑上使用的。代理的地址要怎么配置才好,对代理不太懂。
```
cat http-proxy.conf

[Service]
Environment="HTTP_PROXY=http://192.168.1.100:8080" # HTTP 代理
Environment="HTTPS_PROXY=http://192.168.1.100:8080" # HTTPS 代理
Environment="NO_PROXY=localhost,127.0.0.1,10.0.0.0/8,.internal" # 直连的地址
mag@Mag:/etc/systemd/system/docker.service.d$ cd -
/home/mag/tools/mysql-docker

mag@Mag:~/tools/mysql-docker$ sudo systemctl daemon-reload
mag@Mag:~/tools/mysql-docker$ sudo systemctl restart docker

mag@Mag:~/tools/mysql-docker$ docker-compose up
Pulling db (mysql:8.0)...
ERROR: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 192.168.1.100:8080: connect: no route to host

docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 192.168.1.100:8080: connect: no route to host
```

zed1018

5

zed1018      2025 年 7 月 20 日

代理如果是在 win 上,直接用 localhost+端口就行了,可以先用 nc 测试一下

Lemonadeccc

7

Lemonadeccc      2025 年 7 月 20 日

如果是在自己 win 上,梯子开 tun 就行

Mar5

8

Mar5      2025 年 7 月 20 日

建议搞了透明代理,省的配置这个配置那个。

Meditation

10

Meditation      2025 年 7 月 20 日

@capric 貌似不支持代理?

wsl -d Ubuntu hostname -I
wsl: 检测到 localhost 代理配置,但未镜像到 WSL 。NAT 模式下的 WSL 不支持 localhost 代理。
172.20.107.81 172.17.0.1 172.18.0.1

daisyfloor

12

daisyfloor      2025 年 7 月 20 日   ❤️ 1

- wsl2 配置里网络改为 mirror 模式: networkingMode=mirrored
- windows 上代理软件使用 tun 模式: 并开启严格路由 strict-route: true , 且 tun 的 mtu 改为 1500

这样配置后,在可靠的 TUN 网络下,wsl2 自己(如 apt update 或者 curl )和 docker 引擎(如镜像拉取,容器网络请求)都可以正常无感知使用代理。

labubu

13

labubu      2025 年 7 月 20 日

v2rayn 开 tun 模式亲测可行

Xheldon

14

Xheldon      2025 年 7 月 20 日

你需要修改 wslconfig ,网上有教程,后两项关了就可

YaakovZiv

15

YaakovZiv      2025 年 7 月 20 日

Linux 系统使用 docker 可以直接白嫖免费的,谷歌搜索关键词"xuanyuan docker"或者"1ms docker"

hefish

16

hefish      2025 年 7 月 20 日

我是直接在路由器上开了个梯子。。。
如果是外面的服务器,国内的,就开个代理指向家里的梯子,如果是国外的就直接 docker pull

laminux29

17

laminux29      2025 年 7 月 20 日

1. Docker 是原生于 Linux 的系统,不要在 Windows 上用 docker ,不然发生任何问题都不奇怪。推荐使用 Debian 12 系统。

2.请不要使用机场,机场是合租性质,不稳定。一定要买带有 CN2 线路优化的大厂海外 VPS ,比机场稳太多。

3.使用诸如 xShell 之类的 SSH 工具连接 VPS ,并启用 socks 隧道功能。然后去 github 搜 socks 转 http 的小程序,把 socks 隧道转换为 http 隧道。最后编辑 docker 的配置文件:
/etc/systemd/system/multi-user.target.wants/docker.service

在 [Service] 节点下加入:
Environment="HTTP_PROXY=http://socks 转 http 程序所在服务器的 IP:端口/"
Environment="HTTPS_PROXY=http://socks 转 http 程序所在服务器的 IP:端口/"
Environment="NO_PROXY=localhost,10.0.0.0/8,127.0.0.0/8,172.16.0.0/16,192.168.0.0/16"

最后
systemctl daemon-reload
systemctl restart docker
重启 docker 服务就行了。

triptipstop

18

triptipstop      2025 年 7 月 20 日

用 docker-desktop 很舒服 就是得把 扩展 插件 AI 什么的全关了 不然一升级就坑

SenLief

19

SenLief      2025 年 7 月 20 日

docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 192.168.1.100:8080: connect: no route to host

没有连上代理,建议直接宿主机 tun

fakecoder

20

fakecoder      2025 年 7 月 20 日

我是 wsl2 安装了 clash,op 可以试试...

chaleaochexist

21

chaleaochexist      2025 年 7 月 21 日

1. wsl 配置镜像网络
2. 科学上网, 虚拟网卡模式

如果是代理模式, 那就走代理.

gray0

23

gray0      2025 年 7 月 21 日   ❤️ 1

在 wsl2 中,使用主机的 clash 代理,在本地~/.zshrc 或 ~/.bashrc 加入如下内容:
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"

szguan

24

szguan      2025 年 7 月 21 日

## .wslconfig 中:
```
networkingMode=mirrored
autoProxy=true
```

## wsl2 中 /etc/wsl.conf
```
[network]
generateResolvConf = false
```

## wsl2 中 /etc/resolv.conf
```
nameserver 8.8.8.8
```

## 添加代理设置:
sudo nano ~/.bashrc

```
# 使用主机地址( WSL2 镜像网络)
export hostip=127.0.0.1
export hostport=7890 (替换为主机代理端口)
# HTTP/HTTPS 代理(常用程序使用)
export http_proxy="http://${hostip}:${hostport}"
export https_proxy="http://${hostip}:${hostport}"
export HTTP_PROXY="$http_proxy"
export HTTPS_PROXY="$https_proxy"
# SOCKS5 代理(部分支持 SOCKS5 的工具可使用)
export all_proxy="socks5h://${hostip}:${hostport}"
export ALL_PROXY="$all_proxy"
# 排除内网和本地地址不走代理
export no_proxy="localhost.0.0.1,::1,*.local.*.*.168.*"
export NO_PROXY="$no_proxy"

# proxychains4 命令别名(适用于需要强制 SOCKS 的程序)
alias pwget="proxychains4 wget"
alias pcurl="proxychains4 curl"
```

## 使配置生效
`source ~/.bashrc`

Meditation

25

Meditation      2025 年 7 月 22 日

@gray0 卧槽,大佬,你太牛逼了,来在深夜的感慨,本来都准备放弃了。感谢~

```
docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete
Digest: sha256:ec153840d1e635ac434fab5e377081f17e0e15afab27beb3f726c3265039cfff
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/
```

SeanChang

26

SeanChang      2025 年 8 月 27 日

@tt0411 赞~好用~

群主试试轩辕镜像 docker 加速~https://xuanyuan.cloud