Unable to push images to local registry

I am attempting to setup a local registry on my Mac device. However getting exception while pushing images to this local registry. Below are the steps that I am executing:

Running the container

docker run -d -p 5000:5000 --restart=always --name registry -v pwd/data:/var/lib/registry registry:2.5.0-rc.1

Tagging the image

docker pull ubuntu && docker tag ubuntu localhost:5000/ubuntu

docker images
REPOSITORY TAG IMAGE ID CREATED SIZE localhost:5000/ubuntu latest 0f192147631d 22 hours ago 132.8 MB ubuntu latest 0f192147631d 22 hours ago 132.8 MB

While pushing the image to this local registry, push commands keep on retrying and container logs prints the below exception:

docker push localhost:5000/ubuntu:latest The push refers to a repository [localhost:5000/ubuntu] 0738910e0455: Retrying in 4 seconds 21df36b5c775: Retrying in 4 seconds 315fe8388056: Retrying in 4 seconds 7f4734de8e3d: Retrying in 4 seconds

docker logs registry
time="2016-06-30T17:04:14Z" level=error msg="response completed with error" err.code=unknown err.detail="filesystem: mkdir /var/lib/registry/docker: permission denied" err.message="unknown error" go.version=go1.6.2 http.request.host="localhost:5000" http.request.id=7f267451-20c1-4d4e-90fa-52a93b6b8aba http.request.method=POST http.request.remoteaddr="172.17.0.1:37004" http.request.uri="/v2/ubuntu/blobs/uploads/" http.request.useragent="docker/1.12.0-rc2 go/go1.6.2 git-commit/a7119de kernel/4.4.14-moby os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0-rc2 \\(darwin\\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=7.883879ms http.response.status=500 http.response.written=164 instance.id=4fd133bc-0dc6-40b7-970d-691126e6c81e vars.name=ubuntu version=v2.5.0-rc.1

I am using docker version
docker --version Docker version 1.12.0-rc2, build 906eacd, experimental

Any help will be much appreciated.

Hello,

if you are running Docker on a system that uses SELinux you will need to issue the following:-

chcon -Rt svirt_sandbox_file_tpwd/data

The pwd is a little confusing so you might want to just issue the following:-

mkdir /data chcon -Rt svirt_sandbox_file_t /data

1 Like

I`m running into the very same issue using docker for Mac.

I believe I found a blog post referring the issue:

It’s important to note that we’re using a domain containing a β€œ.” here, i.e. localhost.domain. Docker looks for either a β€œ.” (domain separator) or β€œ:” (port separator) to learn that the first part of the repository name is a location and not a user name. If you just had localhost without either .localdomain or :5000 (either one would do) then Docker would believe that localhost is a username, as in localhost/ubuntu or samalba/hipache. It would then try to push to the default Central Registry. Having a dot or colon in the first part tells Docker that this name contains a hostname and that it should push to your specified location instead.

https://blog.docker.com/2013/07/how-to-use-your-own-registry/

Hi I am also facing the same issue .
Using MiniKube and virtual machines using virtual box. Created 3 VM’s - Registry, Development box for docker and Minikube

ISSUE:

\w$ docker push $REG_IP:80/myweb
The push refers to a repository [192.168.99.108:80/myweb]
3904f73c0b5a: Layer already exists
f35045aca001: Retrying in 1 second
52fc6442242f: Layer already exists
bd00cdbae641: Layer already exists
af43131c4039: Layer already exists
9bd4c7af882a: Layer already exists
04ab82f865cf: Layer already exists
c29b5eadf94a: Layer already exists

Issue type : Upload failed: received unexpected HTTP status: 500 Internal Server Error"

 OS Version/build: MAC OS 10.11.6
App version : Docker 1.11
Steps to reproduce - as mentioned in this post:

LOG:
time=β€œ2017-03-23T15:47:10.469166991Z” level=debug msg="uploaded layer sha256:9bd4c7af882add630050020f9e9b0c4683218cb26054f955f82bcd8db051cf00 (sha256:958046a70c9d6a8160f8f4fb8f81fff3cdb85bceb6206b5842a8f988493425f7), 357 bytes"
time=β€œ2017-03-23T15:47:10.916101121Z” level=debug msg="uploaded layer sha256:04ab82f865cf3b278ed27279067e57c8bcc0b9e7fdaffb474398ee803c0ca4cb (sha256:a994fca0b2a328c2e14dc93b4ae43b033fcfb726a73d22e38f27b5b9ab2f6f71), 72621 bytes"
time=β€œ2017-03-23T15:47:32.448772442Z” level=debug msg="uploaded layer sha256:3904f73c0b5ab443b614aa0c13a3f0147ee51a758424a5a23f1e64c246cc728a (sha256:e0582baf7f281871235caa0befd670591bf609330740c7e0b79c57a80577f835), 162435771 bytes"
time=β€œ2017-03-23T15:48:02.804173326Z” level=debug msg="uploaded layer sha256:c29b5eadf94a90a2abda13e765d4fad4825fd15621dea1d9a98b60b89b835c2a (sha256:d24bc6f195c3546ffad21f479176fecee0b8a6770b852e35d6c45186608de767), 67097255 bytes"
time=β€œ2017-03-23T15:48:58.729781939Z” level=error msg="Upload failed, retrying: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:03.730276221Z” level=debug msg="Pushing layer: sha256:f35045aca00110249f9fa630f11b4da3321b1e9aae4ccc42fb78e91152206c19"
time=β€œ2017-03-23T15:49:03.737542276Z” level=error msg="Upload failed, retrying: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:13.738016386Z” level=debug msg="Pushing layer: sha256:f35045aca00110249f9fa630f11b4da3321b1e9aae4ccc42fb78e91152206c19"
time=β€œ2017-03-23T15:49:13.740733181Z” level=error msg="Upload failed, retrying: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:28.741505364Z” level=debug msg="Pushing layer: sha256:f35045aca00110249f9fa630f11b4da3321b1e9aae4ccc42fb78e91152206c19"
time=β€œ2017-03-23T15:49:28.745405475Z” level=error msg="Upload failed, retrying: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:48.745930113Z” level=debug msg="Pushing layer: sha256:f35045aca00110249f9fa630f11b4da3321b1e9aae4ccc42fb78e91152206c19"
time=β€œ2017-03-23T15:49:48.749128848Z” level=error msg="Upload failed: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:48.749287955Z” level=error msg="Attempting next endpoint for push after error: received unexpected HTTP status: 500 Internal Server Error"
time=β€œ2017-03-23T15:49:48.749308901Z” level=debug msg="Skipping v1 endpoint https://192.168.99.108:80 because v2 registry was detected"
time=β€œ2017-03-23T15:49:48.749318010Z” level=debug msg="Skipping v1 endpoint http://192.168.99.108:80 because v2 registry was detected"
time=β€œ2017-03-23T15:49:57.830599278Z” level=debug msg="Calling GET /_ping"
time=β€œ2017-03-23T15:56:51.285378607Z” level=debug msg="Calling GET /_ping"
time=β€œ2017-03-23T15:56:51.285624466Z” level=debug msg="Calling GET /v1.26/containers/registry/json"
time=β€œ2017-03-23T15:56:51.285659363Z” level=error msg="Handler for GET /v1.26/containers/registry/json returned error: No such container: registry"
time=β€œ2017-03-23T15:56:56.695685122Z” level=debug msg="Calling GET /_ping"
time=β€œ2017-03-23T15:56:56.695904326Z” level=debug msg="Calling GET /v1.26/containers/registry/json"
time=β€œ2017-03-23T15:56:56.695934793Z” level=error msg="Handler for GET /v1.26/containers/registry/json returned error: No such container: registry"
time=β€œ2017-03-23T15:57:47.750575767Z” level=debug msg="Calling GET /v1.23/containers/registrytestdist/json"
time=β€œ2017-03-23T15:57:47.750643326Z” level=error msg="Handler for GET /v1.23/containers/registrytestdist/json returned error: No such container: registrytestdist"
time=β€œ2017-03-23T15:57:55.786919906Z” level=debug msg="Calling GET /v1.23/containers/registry/json"
time=β€œ2017-03-23T15:57:55.786979837Z” level=error msg="Handler for GET /v1.23/containers/registry/json returned error: No such container: registry"
time=β€œ2017-03-23T15:58:37.491912709Z” level=debug msg="Calling GET /v1.15/version"
time=β€œ2017-03-23T15:59:18.935764301Z” level=debug msg="Calling GET /v1.23/containers/myweb/json"
time=β€œ2017-03-23T15:59:18.935823701Z” level=error msg="Handler for GET /v1.23/containers/myweb/json returned error: No such container: myweb"
time=β€œ2017-03-23T15:59:32.653648145Z” level=debug msg="Calling GET /v1.23/containers/json?all=1"
time=β€œ2017-03-23T15:59:41.526328921Z” level=debug msg="Calling GET /v1.23/containers/d3e2532688d9/json"
time=β€œ2017-03-23T15:59:41.529054435Z” level=debug msg="Calling GET /v1.23/containers/d3e2532688d9/logs?stderr=1&stdout=1&tail=all"
time=β€œ2017-03-23T15:59:41.529171475Z” level=debug msg="logs: begin stream"
time=β€œ2017-03-23T15:59:41.575003832Z” level=debug msg="logs: end stream"
time=β€œ2017-03-23T16:19:16.902023119Z” level=debug msg=β€œCalling GET /_ping”

Hey biasao, were u able to solve this 500 internal server error problem while Push tp private repository ?

Please reply … awaiting and it’s an urgent issue to be solved. I am blocked and not able to proceed.

I can confirm the same problem on macOS sierra, pushing an image result in the last layer retrying without cease. Albeit IT DID manage to get upload 100%. Obviously the last acknowledgement is getting lost somewhere.

Anyone have an answer yet?

thanks solved my problem