Reputation: 198398
When I run docker info
, it shows such information:
~ $ docker info
Containers: 0
Images: 8
Server Version: 1.9.1
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 9
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.13-boot2docker
Operating System: Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015
CPUs: 1
Total Memory: 1.956 GiB
Name: default
ID: CXQT:PB43:QNMD:W5JY:66QM:QRI7:GJUB:X27R:RQ4U:53I2:QVJS:DYKV
Debug mode (server): true
File Descriptors: 17
Goroutines: 29
System Time: 2015-12-15T06:26:35.824197223Z
EventsListeners: 1
Init SHA1:
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker
Username: freewind
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
You can notice at the bottom there is a Registry
:
Registry: https://index.docker.io/v1/
I want to know to change this value, say, to change it to http://localhost:5000
, so it will always pull images from http://localhost:5000
?
PS: I already tried to add --engine-registry-mirror http://localhost:5000
when creating a docker machine:
docker-machine create -d virtualbox \
--engine-registry-mirror http://localhost:5000 default
And in the /mnt/sda1/var/lib/boot2docker/profile
of the machine, it contains the content:
EXTRA_ARGS='
--label provider=virtualbox
--registry-mirror http://localhost:5000
'
In order to ask it to pull images from http://localhost:5000
first. But I still wonder how to change the global Registry
value (shows in docker info
)
Upvotes: 3
Views: 1124
Reputation: 1329672
how to change the global Registry value (shows in docker info)
This seems fixed in registry/config.go#L30-L31
// IndexServer is the v1 registry server used for user auth + account creation
IndexServer = DefaultV1Registry + "/v1/"
Note that the registry service will first look for v2 endpoint anyway.
func (s *Service) lookupEndpoints(repoName reference.Named) (endpoints []APIEndpoint, err error) {
endpoints, err = s.lookupV2Endpoints(repoName)
Issue 16974 asks "why not make mirror support a private v2 registry until now?"
Without going into detail, the main issue here is trust and provenance. Basically, the registry controls the naming, so once you point the daemon at another registry, you can no longer trust the content if layers collide. We avoid these issues by disallowing arbitrary mirroring.
This is a situation we are working on resolving but it will take some effort to appropriately address.
More specifically, this is followed in distribution PR 1136, with Proxying to other Registries:
A pull-through caching mode exists for the registry, but is restricted from within the docker client to only mirror the official Docker Hub.
This functionality can be expanded when image provenance has been specified and implemented in the distribution project.
For now, all you can do is to add --disable-legacy-registry
to make sure to consider only V2 ones. That won't change the docker info
output though.
Upvotes: 1