Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] 关于自建镜像 DockerHub 之外代理的疑问 #1772

Open
icefery opened this issue Aug 16, 2024 · 4 comments
Open

[Question] 关于自建镜像 DockerHub 之外代理的疑问 #1772

icefery opened this issue Aug 16, 2024 · 4 comments

Comments

@icefery
Copy link

icefery commented Aug 16, 2024

描述问题

  1. 目前有没有办法不通过增加前缀的方式,而是通过配置 mirror 的方式代理多个镜像仓库呢(拉取 DockerHub 成功,其它失败)?

  2. 通过增加前缀的方式,不使用域名,仅仅是通过 ip + port 能否拉取呢(尝试失败)?

    # 临时使用代理拉取(成功)
    https_proxy="https://192.168.31.8:7890" podman pull registry.k8s.io/ingress-nginx/controller:v1.11.1
    
    # 增加前缀的方式拉取(成功)
    podman pull k8s.kubesre.xyz/ingress-nginx/controller:v1.11.1
    
    # 增加前缀的方式拉取(失败)
    podman pull k8s.192.168.31.101:8080/ingress-nginx/controller:v1.11.1
    Trying to pull k8s.192.168.31.101:8080/ingress-nginx/controller:v1.11.1...
    Error: initializing source docker://k8s.192.168.31.101:8080/ingress-nginx/controller:v1.11.1: reading manifest v1.11.1 in 192.168.31.101:8080/ingress-nginx/controller: denied
    

截图

额外的日志信息

Copy link

Hi @icefery,
感谢您的反馈!
我们会尽快跟进.

Details

Instructions for interacting with me using comments are available here.
If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

@gebangfeng
Copy link
Collaborator

podman pull k8s.kubesre.xyz/ingress-nginx/controller:v1.11.1

这种属于前缀替换的方式了。
增加前缀是,比如要拉取的镜像是 docker.io/nginx:latest
增加前缀就是 kubesre.xyz/docker.io/nginx:latest

至于你用的k8s.kubesre.xyz 他会做一个重定向到 kubesre.xyz/registry.k8s.io/ingress-nginx/controller:v1.11.1

以上的是需要有一个域名的。

如果你想用ip方式拉取,需要在配置文件中信任下仓库:
用docker举例
一、配置Docker信任地址
修改Docker守护进程配置文件:

vi /etc/docker/daemon.json

通过vi打开文件后,添加文件内容如下:

 {
   "insecure-registries":["http://你的ip地址:8090"]
}

@Serverdowno
Copy link

podman pull k8s.kubesre.xyz/ingress-nginx/controller:v1.11.1

这种属于前缀替换的方式了。 增加前缀是,比如要拉取的镜像是 docker.io/nginx:latest 增加前缀就是 kubesre.xyz/docker.io/nginx:latest

至于你用的k8s.kubesre.xyz 他会做一个重定向到 kubesre.xyz/registry.k8s.io/ingress-nginx/controller:v1.11.1

以上的是需要有一个域名的。

如果你想用ip方式拉取,需要在配置文件中信任下仓库: 用docker举例 一、配置Docker信任地址 修改Docker守护进程配置文件:

vi /etc/docker/daemon.json

通过vi打开文件后,添加文件内容如下:

 {
   "insecure-registries":["http://你的ip地址:8090"]
}

请问,containerd配置跳转不支持后缀,比如kubesre.xyz/registry.k8s.io 后面带registry.k8s.io就不行了,请求地址就不走这个了,单独写kubesre.xyz不加后缀可以请求,这个需要怎么解决下?

@gebangfeng
Copy link
Collaborator

gebangfeng commented Aug 30, 2024

有详细报错吗,你也可以在https://dockerimage.gbfeng.com/最下方联系到我。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants