你们的 NAS 能访问 hub.docker.com 吗,反正我时折腾了半天,没办法了

90 天前
 Rust2015

以前,威联通还可以通过修改 run-docker.sh 文件进行代理上网

现在,不行了

不知道,大家都是怎么访问 hub.docker.com 拉取镜像的

6406 次点击
所在节点    NAS
66 条回复
mMartin
90 天前
手动导入镜像
wyjson
90 天前
可以自己做个代理,试试 docker.wyjson.com
V2April
90 天前
在 pc 上 docker pull ,导出成压缩包,复制到 nas 再 docker load 。我现在都是这么做的,反正也不经常需要 pull
itxh
90 天前
个人整理的一些可用的镜像源,切换即可

[国内可用 Docker 镜像源加速器/DockerHub 镜像汇总(2024 年 11 月 25 日) - 文武科技柜]( https://www.wangdu.site/course/2109.html)
pxiphx891
90 天前
路由器上用 openclash 代理 hub.docker.com 流量
sampeng
90 天前
自己有境外机器的话自建一个 docker 镜像库。用啥拉啥。比 cf 稳定多了…
pigeon2049
90 天前
docker-compose.yml
```
name: docker-proxy
services:
registry:
image: registry:2
ports:
- '5000:5000'
volumes:
- ./config.yml:/etc/docker/registry/config.yml
- registry_data:/var/lib/registry
restart: always
container_name: registry
hostname: registry
logging:
driver: "json-file"
options:
max-size: "10m"
volumes:
registry_data:

```


config.yml
```
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
proxy:
remoteurl: http://registry-1.docker.io
```


nginx xxx domain.conf
```
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;

ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_trusted_certificate /ssl/origin_ca_rsa_root.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519:P-256:P-384:P-521;
ssl_early_data on;
ssl_stapling on;
ssl_stapling_verify off;

add_header Strict-Transport-Security "max-age=63072000" always;
server_name xxx.domains;

location /v2/ {
# Allow GET, HEAD, OPTIONS requests
if ($request_method !~ ^(GET|HEAD|OPTIONS)$ ) {
return 405; # Method Not Allowed
}
# Proxy requests to the registry
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}


}

server {
listen 80;
listen [::]:80;
server_name xxx.domains;
return 301 https://xxx.domains$request_uri;
}
```


usage:
```
官方镜像
docker pull youdomain/library/postgres:12.22-bookworm

非官方镜像
docker pull youdomain/redis/redis-stack-server

```
pigeon2049
90 天前
brucecao
90 天前
@guazila 我的反代有个问题是不能显示是否有更新。只能强制更新。
JensenQian
90 天前
前面放个 openwrt 的软路由爬墙
完事了
zbatman
90 天前
@Rust2015 不套别进
jqknono
90 天前
除了梯子以外, 还要选海外 dns, 国内 dns 有污染
marquina
90 天前
自建 docker hub 镜像: https://www.yooo.ltd/2024/06/08/self-host-docker-hub-mirror/
abc8678
89 天前
以前听过两种说法。一个是 nas 别挂梯子,以免 ddns 等受到影响。另一个是为了使用 docker ,需要用旁路由。所以还得细分域名才能挂了…
WhatTheBridgeSay
89 天前
网关透明代理解菌忧愁
ysc3839
89 天前
端口转发+改 hosts 不就好了?
HackerTerry
89 天前
没有旁路由,每次拉取 docker 镜像的时候就把威联通 nas 的 socks5 代理服务器设置成电脑的局域网 IP ,然后电脑打开 v2rayn 全局模式,用完了再恢复原来的配置
socoollike
89 天前
主路由分流特定域名到 WAN2 ,WAN2 上接个软路由双拨
viazure
89 天前
用 CF 自建一个 Docker 仓库镜像:<https://github.com/cmliu/CF-Workers-docker.io>
cornorj6
89 天前
旁路由,一步到位。换源和 docker 代理我都折腾过,不如旁路由省心。因为不仅仅 docker 需要翻墙,很多其他软件也要翻墙。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1093303

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX