问题
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