Mehdi
Mehdi

Reputation: 5597

Internal Server Error When Push to Private Docker Registry on Windows

I'm trying to create a private repository according to this article: https://www.codeproject.com/Articles/1263817/How-to-Setup-Our-Own-Private-Docker-Registry

my platform is windows 10 and using docker on desktop.

but i experienced this error when push to my 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

this is

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

is there any opinion to fix that issue? this is issue observed only when i am in Windows Container mode. when i switch to Linux Container mode everything is ok!

Upvotes: 3

Views: 12138

Answers (4)

DJ Grossman
DJ Grossman

Reputation: 600

I experienced the same 500 error on Windows 11 when pushing a Windows image to a local registry. To resolve, I had to add this setting to my registry's yaml config:

validation:
   disabled: true

Source: https://github.com/distribution/distribution/issues/2232#issuecomment-297788575

Upvotes: 0

Joe Savage
Joe Savage

Reputation: 993

I had the same problem -- able to push linux images but pushing any windows image would give the same 500: internal server error. I got this to work by disabling validation, as indicated here: https://github.com/docker/distribution/issues/2232

You can pass -e REGISTRY_VALIDATION_DISABLED=true on the command line to docker run, or add REGISTRY_VALIDATION_DISABLED: 'true' to the registry->environment section of docker-compose.yaml.

Example:

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

or in docker-compose.yaml:

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

Upvotes: 2

mchawre
mchawre

Reputation: 12268

Add insecure-registry option in docker configuration and restart docker service. And then try docker push using machine-ip:5000

Check this out.

Upvotes: 1

nPcomp
nPcomp

Reputation: 9933

If you set up a secure registry, you need to login to docker registry with something like this:

docker login --username=yourusername [email protected]:5000

and then you can do

docker push localhost:5000/my-alpine

Also, from gitBash check if you are getting anything with curl

Try:

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

You may need to use username:pass combo with curl. Of course, always check to see if you are docker registry container is running or exited.

Upvotes: 0

Related Questions