Reputation: 7602
When I mistype things it tries to search in the central registry. How to disable it completely?
Is there an option to clear that URL?
Upvotes: 11
Views: 5261
Reputation: 13
create a json file in
/etc/containers/policy.json
with content:
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker":
{
"docker.io": [{"type":"reject"}]
}
}
}
reload the daemon
systemctl daemon-reload
restart docker or crio or any container technology we use
eg: systemctl restart docker
eg: systemctl restart crio
NOTE: to block multiple repo's: just add the repos in this format in the docker block in the above json:
"docker":
{
"abc.repo1.io": [{"type":"reject"}],
"abc.repo2.io": [{"type":"reject"}],
"docker.io": [{"type":"reject"}]
}
Upvotes: 0
Reputation: 1329692
As a reference, right now (docker 1.9, Nov 2015):
pull.go
looks for pull endpoints:
s.registryService.LookupPullEndpoints()
registry/service.go
looks for V2 endpoint:
s.lookupEndpoints(repoName)
registry/service_v2.go
appends DefaultV2Registry
:
endpoints = append(endpoints, APIEndpoint{
URL: DefaultV2Registry,
registry/config_unix.go
includes DefaultV2Registry
:
DefaultV2Registry = "https://registry-1.docker.io"
So until there is an option to not look for that endpoint, docker pull
will still include that central default V2 registry.
Upvotes: 2