How to login to a Docker Registry that has an HTTP prefix set?

I have setup my own Docker Registry, but I did not want it on the root URL so when I created the service I used the REGISTRY_HTTP_PREFIX environment variable and set it to /registry/, thus the URL to the registry is https://tools.example.com/registry. This is being proxied by Nginx which has Basic Auth setup on it.

I tested access to the registry using a Browser and I was able to get it to show that there are no repositories by going to http://tools.example.com/registry/v2/_catalog:

This led me to think that it was workoing. However when I try to login to the registry using the Docker command line, I get the Basic Auth challenge but then it fails to login because the URL is incorrect, e.g.

As can be seen from the error, the prefix is not being added properly. SO how can I login to the registry so I can push images. Is there an environment variable or something that I am missing to make the docker login work properly?

Update - 2017-08-12 2253 BST

I Have been playing around with the configuration a bit, but I am still not getting very far.

My Docker Registry service is deployed as registry and is running on the default port of 5000. Looking at this now I think I have got things confused. I do not need the registry to answer on the prefix itself, just Nginx.

For example if I leave the location set to / then I can login, but if I change this to /registry/ then I am not able to. I am beginning to think that the two are conflicting each other.

Registry

I have not set a configuration for the Registry other than the one environment variable - REGISTRY_HTTP_PREFIX, which maybe surplus to requirements in this setup.

See also questions close to this topic

I'm trying to create docker machine host using the following command in fedora OS version 25.

docker-machine create -driver=virtualbox host01

I get below error while executing the command.

Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is \"WARNING:
The vboxdrv kernel module is not loaded.
Either there is no module available for the current kernel (4.10.12-200.fc25.x86_64) or it failed to load.
Please try load the kernel module by executing as root
dnf install akmod-VirtualBox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service
You will not be able to start VMs until this problem is fixed.\\n5.1.26r117224\".
Please upgrade at https://www.virtualbox.org"

I have already virtualbox latest version installed. Running the command suggested by

Docker has just released a 17.06 version of docker-ee. But there is no selinux rpm in trial packages "/rhel/7.3/x86_64/stable-17.06/Packages/", and yum install docker-ee-17.06.1.ee.1-1.el7.rhel.x86_64.rpm failed because of selinux needed.

Docker push is failing when I have large HDF5 files in the image. One file is between 2.4 and 3.2 GB. It doesn't matter which file it is, it will always fail. Small HDF5 files (19MB) will succeed.

I actually do not get any error message if I attempt to push to the docker registry. The UI looks like it is pushing the file, then when it has pushed all the bytes (100%), it says "Retrying in 15s", and then starts all over again.

I have some error logs from the gitlab-registry below, but a "docker push --verbose" method would be quite helpful.