How to change the default docker registry from docker.io to my private registry?

By default, if I issue command:

sudo docker pull ruby:2.2.1

it will pull from the docker.io offical site by default.

Pulling repository docker.io/library/ruby

How do I change it to my private registry. That means if I issue

sudo docker pull ruby:2.2.1

it will pull from my own private registry, the output is something like:

Pulling repository my_private.registry:port/library/ruby

12 Answers
12

Leave a Comment