Docker mirror for windows images

Viewed 414

Good day! I have problems with configuring docker private registry. I can create a docker private registry on Linux RHEL. I configured it work as a mirror, and I can pull images from global DOCKER HUB, for Linux without a problem. But when I try to configuration this private registry work as a mirror for Windows machine. I can pull images from mcr.microsoft.com. Can anybody help me?

correct for LINUX:

version: 0.1
log:
  fields:
    service: registry
storage:
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :5000
proxy:
  remoteurl: https://registry-1.docker.io

if I change on

proxy:
  remoteurl: https://mcr.microsoft.com

doesn't​ work.

1 Answers

Got it to work like this:

My config.yml is in ~/.docker/docker-registry. It looks like this:

version: 0.1
log:
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3
proxy:
  remoteurl: https://mcr.microsoft.com

I run the registry image like this:

docker run --restart=always -p 5000:5000 --name v2-mirror -v ~/.docker/docker-registry:/var/lib/registry --detach registry:2 serve /var/lib/registry/config.yml

In my case, the container is reachable from a windows machine at 172.16.68.1:5000.

Then I can do a docker pull 172.16.68.1:5000/windows/nanoserver:1809

Note that the "pull-through cache" feature is not available for registries other than the official docker hub, see docker doc:

It’s currently not possible to mirror another private registry. Only the central Hub can be mirrored.

Related