gpt4 book ai didi

docker - 在 Windows 上推送到私有(private) Docker 注册表时出现内部服务器错误

转载 作者:行者123 更新时间:2023-12-02 19:57:52 25 4
gpt4 key购买 nike

我正在尝试根据这篇文章创建一个私有(private)存储库:https://www.codeproject.com/Articles/1263817/How-to-Setup-Our-Own-Private-Docker-Registry

我的平台是 windows 10 并在桌面上使用 docker。

但是我在推送到我的私有(private)时遇到了这个错误:

>docker push localhost:5000/my-alpine

The push refers to repository [localhost:5000/my-alpine]
a464c54f93a9: Retrying in 1 second
received unexpected HTTP status: 500 Internal Server Error

这是

time="2019-06-22T13:57:07.4534462Z" level=error msg="response completed with error" err.code="blob unknown" err.detail=sha256:bdf0201b3a056acc4d6062cc88cd8a4ad5979983bfb640f15a145e09ed985f92 err.message="blob unknown to registry" go.version=go1.11.2 http.request.host="localhost:5000" http.request.id=8c71d5fa-41f1-49e4-9cab-2042e2cef0fa http.request.method=HEAD http.request.remoteaddr="172.30.80.1:1657" http.request.uri="/v2/my-alpine/blobs/sha256:bdf0201b3a056acc4d6062cc88cd8a4ad5979983bfb640f15a145e09ed985f92" http.request.useragent="docker/18.09.1 go/go1.10.6 git-commit/4c52b90 os/windows arch/amd64 UpstreamClient(Docker-Client/18.09.1 \(windows\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=2.6325ms http.response.status=404 http.response.written=157 vars.digest="sha256:bdf0201b3a056acc4d6062cc88cd8a4ad5979983bfb640f15a145e09ed985f92" vars.name=my-alpine
172.30.80.1 - - [22/Jun/2019:13:57:07 +0000] "HEAD /v2/my-alpine/blobs/sha256:bdf0201b3a056acc4d6062cc88cd8a4ad5979983bfb640f15a145e09ed985f92 HTTP/1.1" 404 157 "" "docker/18.09.1 go/go1.10.6 git-commit/4c52b90 os/windows arch/amd64 UpstreamClient(Docker-Client/18.09.1 \\(windows\\))"
172.30.80.1 - - [22/Jun/2019:13:57:07 +0000] "POST /v2/my-alpine/blobs/uploads/ HTTP/1.1" 500 258 "" "docker/18.09.1 go/go1.10.6 git-commit/4c52b90 os/windows arch/amd64 UpstreamClient(Docker-Client/18.09.1 \\(windows\\))"
time="2019-06-22T13:57:07.8604305Z" level=error msg="response completed with error" err.code=unknown err.detail="filesystem: truncate /var/lib/registry/docker/registry/v2/repositories/my-alpine/_uploads/8e29f389-ebd5-4d6f-ba80-7be8315c6311/startedat: permission denied" err.message="unknown error" go.version=go1.11.2 http.request.host="localhost:5000" http.request.id=b3de21ad-7b97-4560-8987-84ff62aecb9b http.request.method=POST http.request.remoteaddr="172.30.80.1:1660" http.request.uri="/v2/my-alpine/blobs/uploads/" http.request.useragent="docker/18.09.1 go/go1.10.6 git-commit/4c52b90 os/windows arch/amd64 UpstreamClient(Docker-Client/18.09.1 \(windows\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=100.4211ms http.response.status=500 http.response.written=258 vars.name=my-alpine

有什么意见可以解决这个问题吗?这是仅当我处于 Windows Container 模式时才观察到的问题。当我切换到 Linux Container 模式时一切正常!

最佳答案

我遇到了同样的问题——能够推送 Linux 图像,但推送任何 Windows 图像都会给出相同的 500:内部服务器错误。我通过禁用验证来实现它,如下所示:https://github.com/docker/distribution/issues/2232

可以在命令行传递-e REGISTRY_VALIDATION_DISABLED=true到docker run,或者在docker->registry->environment部分添加REGISTRY_VALIDATION_DISABLED: 'true'撰写.yaml.

例子:

docker run -d -e REGISTRY_VALIDATION_DISABLED=true registry:latest

或者在 docker-compose.yaml 中:

registry:
image: registry:latest
environment:
REGISTRY_VALIDATION_DISABLED: 'true'

关于docker - 在 Windows 上推送到私有(private) Docker 注册表时出现内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56716259/

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