Skip to content

Instantly share code, notes, and snippets.

@jatin-lab49
Last active June 22, 2020 20:34
Show Gist options
  • Save jatin-lab49/18feba3f1610d57123b729494b7f0ef9 to your computer and use it in GitHub Desktop.
Save jatin-lab49/18feba3f1610d57123b729494b7f0ef9 to your computer and use it in GitHub Desktop.
TIL-Lab49/Docker image pull with private registry

Sometimes, if you are behind a corporate proxy - docker pull fails to download images from dockerhub with an error like below:

$ sudo docker pull swaggerapi/swagger-codegen-cli
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: read tcp 10.0.2.15:50136->3.223.220.229:443: read: connection reset by peer

You can check if the image is in your private registry by prepending the private docker hub before the image and checking if it works.

docker pull docker-hub.docker.myorg.com/swaggerapi/swagger-codegen-cli

In this case, you can edit your ~/.docker/daemon.json to contain an entry for registry-mirrors

{  
  "debug" : true,  
  "experimental" : false,  
  "registry-mirrors" : [  
    "https://docker-hub.docker.myorg.com"  
  ]  
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment