How do I push to minishift's built-in docker registry?

巧了我就是萌 提交于 2021-02-08 10:04:08

问题


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

回答1:


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

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

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


来源:https://stackoverflow.com/questions/56906657/how-do-i-push-to-minishifts-built-in-docker-registry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!