簡體   English   中英

推送到 Windows 上的私有 Docker 注冊表時出現內部服務器錯誤

[英]Internal Server Error When Push to Private Docker Registry on Windows

我正在嘗試根據這篇文章創建一個私有存儲庫: https : //www.codeproject.com/Articles/1263817/How-to-Setup-Our-Own-Private-Docker-Registry

我的平台是 Windows 10 並在桌面上使用 docker。

但是我在推送到我的私人時遇到了這個錯誤:

>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 容器模式時才觀察到的問題。 當我切換到Linux 容器模式時一切正常!

在 docker 配置中添加insecure-registry選項並重新啟動 docker 服務。 然后使用machine-ip:5000嘗試docker push

看看這個

如果您設置了安全注冊表,則需要使用以下內容登錄 docker registry:

docker login --username=yourusername --email=email@domain.com:5000

然后你可以做

docker push localhost:5000/my-alpine

另外,從gitBash檢查您是否收到curl任何信息

嘗試:

curl -X GET https://myregistry:5000/v2/_catalog

您可能需要將username:pass組合與curl 當然,請始終檢查您的 docker registry 容器是否正在運行或退出。

我遇到了同樣的問題——能夠推送 linux 映像,但推送任何 Windows 映像都會產生相同的 500: 內部服務器錯誤。 我通過禁用驗證來實現這一點,如下所示: https : //github.com/docker/distribution/issues/2232

您可以在命令行上將-e REGISTRY_VALIDATION_DISABLED=true傳遞給 docker run,或者將REGISTRY_VALIDATION_DISABLED: 'true'添加到 docker-compose.yaml 的 registry->environment 部分。

例子:

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

或在 docker-compose.yaml 中:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM