Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active August 28, 2019 23:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbraad/7cb36210bd5effdeb788c34d6b433ac8 to your computer and use it in GitHub Desktop.
Save gbraad/7cb36210bd5effdeb788c34d6b433ac8 to your computer and use it in GitHub Desktop.
Minishift registry mirror

Minishift registry mirror on Windows

Prerequisites

  • Windows 10
  • Hyper-V installed
  • Docker for Windows

Instructions

Setup the registry mirror

C:\>docker run -d --restart=always -p 5000:5000 --name registry-mirror registry:2 
C:\>docker exec -it registry-mirror vi /etc/docker/registry/config.yml

Add to the config

proxy:
   remoteurl: https://registry-1.docker.io
   username: [your username]
   password: [your password]
C:\>docker restart registry-mirror

Now test from your browser: http://10.0.75.1:5000/v2/_catalog

C:\>minishift config set check-network-ping-host 10.0.75.1
C:\>minishift config set check-network-http-host http://10.0.75.1:5000/v2/
C:\>minishift config set insecure-registry 10.0.75.1
C:\>minishift config set registry-mirror http://10.0.75.1:5000
C:\>set HYPERV_VIRTUAL_SWITCH=Wireless
C:\>minishift start

Now check if the mirror has images: http://10.0.75.1:5000/v2/_catalog

Note: Virtual switch does not have access to the DockerNAT network. Need to find a workaround.

Additional steps

You can also setup Docker for Windows to use the registry mirror. For this you need ot modify the settings using the Advanced configuration option:

{
  "registry-mirrors": [
    "http://10.0.75.1:5000"
  ],
  "insecure-registries": [
    "10.0.75.1"
  ],
  "debug": true,
  "experimental": true
}
@gbraad
Copy link
Author

gbraad commented Oct 10, 2018

This can be updated to utilize --no-provision to eliminate the need for D4W, and the actual install can be performed as an add-on

@praveenkumar @LalatenduMohanty WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment