Skip to content

Add support for private registry mirroring #570

@namreg

Description

@namreg
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

I want to use registry mirror for my private registry. I add mirror config to daemon.json. But docker daemon does not use mirror for images that located in the my private registry.

Actual behavior

I expect that docker daemon will use registry mirror for my private registry.

Steps to reproduce the behavior

I have noticed this check in the docker engine https://github.com/docker/engine/blob/master/registry/service_v2.go#L12. But I can not understand the intention of it. Maybe we should extract these lines https://github.com/docker/engine/blob/master/registry/service_v2.go#L14-L34 outside the if condition mentioned above?

Output of docker version:

Client:
 Version:           18.06.1.0
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        00df47139d
 Built:             Mon Sep  3 19:00:03 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1.0
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       00df47139d
  Built:            Mon Sep  3 18:58:35 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

Containers: 51
 Running: 40
 Paused: 0
 Stopped: 11
Images: 16
Server Version: 18.06.1.0
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.14.35.4
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.286GiB
Name: P20B-VR3-R1-K8S-N1
ID: V5OC:DITY:K24D:F7RZ:CP4N:PLQK:AFIY:QZWB:BL3P:WNL4:WMUG:J5ZL
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 http://localhost:5000/
Live Restore Enabled: true

Additional environment details (AWS, VirtualBox, physical, etc.)
KVM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions