13

Docker pull can be slow sometimes

How can this best be optimised?

Is it possible to set the mirrors?

Any ideas appreciated. I appreciate sometimes it can just be slow network but would be great to speed this up as much as possible.

1 Answer 1

15

Not exactly a mirror, but you can setup a registry as a pull through cache:

By running a local registry mirror, you can keep most of the redundant image fetch traffic on your local network.
In this mode a Registry responds to all normal docker pull requests but stores all content locally.

The first time you request an image from your local registry mirror, it pulls the image from the public Docker registry and stores it locally before handing it back to you.
On subsequent requests, the local registry mirror is able to serve the image from its own storage.

You will need to pass the --registry-mirror option to your Docker daemon on startup:

docker --registry-mirror=https://<my-docker-mirror-host> daemon
2
  • https://<my-docker-mirror-host> should be i change that on my project? or i should simply code in terminal
    – DolDurma
    Apr 12, 2021 at 5:59
  • @DolDurma No: this is supposed to be used by your Docker Daemon when you are pulling images to your local image registry.
    – VonC
    Apr 12, 2021 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.