I hope someone can help me :))
I have a registry runing in linux/ubuntu registry:2 when I generate and push image based in docker-linux all is done.
but when I generate widows images/container like this FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build ....... build my app
but a get this error when I try to push image to registry(its running in ubuntu)
The push refers to repository [my registry url]
20682f4ff7bf: Layer already exists
364de9d9769f: Layer already exists
459cecac74e0: Layer already exists
d75d3f2676c0: Layer already exists
1ed8b25f5f56: Layer already exists
67814da28689: Layer already exists
a57c2fa5ac49: Layer already exists
b037a641a3b8: Layer already exists
90b1395e7b4f: Layer already exists
0a59c2d473fc: Layer already exists
1612da0ebc3b: Layer already exists
94ce506bdcf2: Skipped foreign layer
f358be10862c: Skipped foreign layer
received unexpected HTTP status: 500 Internal Server Error
registry logs:
.10.16 go/go1.17.10 git-commit/f756502 os/windows arch/amd64 UpstreamClient(Docker-Client/20.10.16 \(windows\))" vars.name="xxxxxx" vars.reference=des
time="2022-07-19T09:49:15.579829667Z" level=error msg="response completed with error" auth.user.name=admin err.code=unknown err.message="unknown error" go.version=go1.11.2 http.request.contenttype="application/vnd.docker.distribution.manifest.v2 json" http.request.host=xxxxxx http.request.id=85ace457-2985-402e-a930-5a2e79f0b6ba http.request.method=PUT http.request.remoteaddr=xxxxx http.request.uri="xxxxxx" http.request.useragent="docker/20.10.16 go/go1.17.10 git-commit/f756502 os/windows arch/amd64 UpstreamClient(Docker-Client/20.10.16 \(windows\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=4.974929ms http.response.status=500 http.response.written=523 vars.name="xxxxxx" vars.reference=des
thank y for any help
CodePudding user response:
I've yet to sort out the magic string that validates the URL's to Windows foreign layers (pretty sure I tried a lot of combinations). So I eventually just disabled validation completely to workaround this error:
docker run -d --restart=unless-stopped --name registry \
-e "REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/registry" \
-e "REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR=inmemory" \
-e "REGISTRY_STORAGE_DELETE_ENABLED=true" \
-e "REGISTRY_VALIDATION_DISABLED=true" \
-v "registry-data:/var/lib/registry" \
-p "127.0.0.1:5000:5000" \
registry:2
Note the -e "REGISTRY_VALIDATION_DISABLED=true"
in the command above.