gpt4 book ai didi

docker - 我的私有(private)存储库在 curl GET 请求中返回二进制内容

转载 作者:行者123 更新时间:2023-12-02 18:07:39 25 4
gpt4 key购买 nike

这是请求及其响应:

$ curl -v -X GET domain.com:5000/v2/_catalog/
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 165.227.161.233...
* TCP_NODELAY set
* Connected to domain.com (165.227.161.233) port 5000 (#0)
> GET /v2/_catalog/ HTTP/1.1
> Host: domain.com:5000
> User-Agent: curl/7.55.1
> Accept: */*
>
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
* Failed writing body (0 != 7)
* Closing connection 0
[stephane@stephane-ThinkPad-X201 ~]
$ curl -v -X GET domain.com:5000/v2/_catalog/
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 165.227.161.233...
* TCP_NODELAY set
* Connected to domain.com (165.227.161.233) port 5000 (#0)
> GET /v2/_catalog/ HTTP/1.1
> Host: domain.com:5000
> User-Agent: curl/7.55.1
> Accept: */*
>
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
* Failed writing body (0 != 7)
* Closing connection 0

这是我在 docker-compose.yml 文件中创建注册表的方式:

version: "3"
services:
registry:
restart: always
image: registry:latest
container_name: registry
ports:
- 5000:5000
volumes:
- ~/dev/docker/registries/registry:/var/lib/registry

我的 docker 版本是:

$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:11:14 2017
OS/Arch: linux/amd64

Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:09:47 2017
OS/Arch: linux/amd64
Experimental: false

最佳答案

由于 ssl 问题,我遇到了同样的错误,因为我的本地 docker 注册表是安全的,所以你必须在本地注册表 url 的开头提到 https://...


curl --key <ssl key file> --cacert <ssl pem file> -X GET https://<your local registry url >:<your port>/v2/_catalog

或不安全:


curl -k -X GET https://<your local registry url >:<your port>/v2/_catalog

关于docker - 我的私有(private)存储库在 curl GET 请求中返回二进制内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48196202/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com