如何将默认Docker注册表从docker.io更改为我的私有注册表? [英] How to change the default docker registry from docker.io to my private registry?

查看:261
本文介绍了如何将默认Docker注册表从docker.io更改为我的私有注册表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,如果我发出命令:

By default, if I issue command:

sudo docker pull ruby:2.2.1

默认情况下,它将从docker.io官方站点拉出。

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


推荐答案

更新:发表您的评论后,当前无法更改默认注册表,请参见此问题有关更多信息。

UPDATE: Following your comment, it is not currently possible to change the default registry, see this issue for more info.

您应该能够做到这一点,将主机和端口替换为自己的主机:

You should be able to do this, substituting the host and port to your own:

docker pull localhost:5000/registry-demo

如果服务器是远程服务器/具有身份验证,您可能需要使用以下命令登录服务器:

If the server is remote/has auth you may need to log into the server with:

docker login https://<YOUR-DOMAIN>:8080

然后运行:

docker pull <YOUR-DOMAIN>:8080/test-image

这篇关于如何将默认Docker注册表从docker.io更改为我的私有注册表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆