Nice info.
People are facing issues with “localhost”, and on the current release (beta 9) the “hostnet” is the default (no NAT). There is a typical case where people are running a “registry:2” locally and want to tag/push images downloaded in order not to pull them again from Docker Hub even after resetting Docker for Mac.
This used to be very simple:
docker pull nginx
docker tag localhost:5000/nginx
docker push localhost:5000/nginx
Well, we must remember that “docker pull” is a daemon thing, so the host part of the registry must make sense inside the VM.
At your Mac terminal the line below returns the expected “{}” response, but not if you run it inside the VM:
curl localhost:5000/v2/
Inside the VM only the IPs assigned to “docker0” and “eth0” work:
curl 192.168.65.2:5000/v2/
curl 172.17.0.1:5000/v2/
I managed to pull it of tagging the images a bit differently:
docker pull busybox
docker tag 192.168.65.2:5000/busybox
docker push 192.168.65.2:5000/busybox
Of course, I had to do the “pinata set daemon” just like @theverything described, but declaring “192.168.65.2:5000” as insecure (NOT localhost:5000).
Other engines on different machines in your LAN can still pull images from your registry, using whatever name or IP your host is known for, but they will also have to do the same “pinata set daemon” (with the proper name, and NOT 192.168.65.2 and NOT localhost).
If you are feeling brave you can also try a different setup:
- pull the registry from hub
- run the registry locally on mirror mode (try another port, say, 5050, if you know how to do it)
3, set the engine with the “registry-mirror” option (same “pinata set daemon” technique, entry is named “registry-mirrors”):
{"storage-driver":"aufs","debug":true,"registry-mirrors":["http://192.168.65.2:5050"]}
- Restart Docker app (this is a VM reboot)
- Other machines on the LAN can do the same, but using your host IP/hostname when setting engine options
With this setting everyone can “docker pull” at will with normal names (no need for tagging), your registry is caching everything.