Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: disable pulling from remote registry

Tags:

docker

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?

like image 292
Velkan Avatar asked Nov 18 '15 07:11

Velkan


People also ask

Does docker RMI Remove from registry?

This does not remove images from a registry. You cannot remove an image of a running container unless you use the -f option. To see all images on a host use the docker image ls command.

Does docker run automatically pull?

We could have skipped the docker pull step; if you use the docker run command and you don't already have a copy of the Docker image, Docker will automatically pull the image first and then run it.

How do I stop docker from using images?

Note that pressing `Ctrl+C` when the terminal is attached to a container output causes the container to shut down.


2 Answers

If you use the a redhat clone with the rpms from centos extras, they have a parameter to do that:

--block-registry hostname

This is a RedHat extension (see here) which I don't think was accepted upstream (considering 13450)

like image 198
cristi Avatar answered Sep 20 '22 17:09

cristi


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.

like image 45
VonC Avatar answered Sep 21 '22 17:09

VonC