如何推送到minishift的内置Docker注册表? [英] How do I push to minishift's built-in docker registry?

查看:54
本文介绍了如何推送到minishift的内置Docker注册表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将标记的构建推送到minishift的内置自定义注册表中,以便可以在OpenShift中使用该映像.我一直遇到权限问题.我该如何解决?

I'm trying to push a tagged build to minishift's built-in custom registry so I can use that image in OpenShift. I keep running into a permission issue. How do I get around this?

$ docker push $registry/tutorial1/start
The push refers to a repository [172.30.1.1:5000/tutorial1/start]
e20ac34b31e3: Preparing
8890c47716ac: Preparing
787471275018: Preparing
ee0ebee0324c: Preparing
a30cfc27bb5d: Preparing
d22688b29911: Waiting
08127eb3eb76: Waiting
a637c551a0da: Waiting
2c8d31157b81: Waiting
7b76d801397d: Waiting
f32868cde90b: Waiting
0db06dff9d9a: Waiting
unauthorized: authentication required

推荐答案

在使用minishift及其内置注册表时,请确保在启动之前使用适当的名称创建了一个项目.例如,我试图使用以下命令推送到Minishift注册表:

When using minishift and their built-in registry, be sure that you have created a project by the appropriate name before starting. For example I was trying to push to the Minishift registry using this command:

docker push $registry/tutorial1/start:0.1

为了完成此任务,我必须创建的项目是 tutorial1 .然后一切都没问题.

The project I had to create in order to accomplish this was tutorial1. Then everything pushed no problem.

您还需要确保已运行 minishift docker-env 输出的命令.

You'll also need to be sure your have run the commands output by minishift docker-env.

这是用于创建项目然后推送到注册表的完整命令集.这不会使用图片或任何此类内容来创建应用.

Here is a complete set of commands to create the project and then push to the registry. This does not create an app using the image or anything of that sort.

oc new-project tutorial1
docker login -u developer -p $(oc whoami -t) $registry
docker tag e909f5aa1b79 $registry/tutorial1/start:latest
docker push $registry/tutorial1/start:latest

这篇关于如何推送到minishift的内置Docker注册表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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