使用Docker API推送到私人注册表 [英] Using Docker API to push to private registry
本文介绍了使用Docker API推送到私人注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将图像推送到私人注册表的语法是什么?
What is the syntax to push an image to a private registry?
从文档中,我希望以下内容可以正常工作:
From the documentation, I would expect the below to work:
curl -X POST -i "http://localhost:2375/images/localhost:5000/oillio/my_app:1.0-SNAPSHOT/push"
我可以使用CLI来执行此操作:
I can use the CLI to do this:
docker push localhost:5000/oillio/my_app:1.0-SNAPSHOT
这工作正常。但是我不知道从API中做什么语法。当我尝试以上,我得到一个状态500响应与文本EOF
This works fine. But I can't figure out what the syntax is to do this from the API. When I try the above, I get a status 500 response with the text "EOF"
推荐答案
标签需要是参数,不在url内:
The tag needs to be as a parameter and not within the url:
/ images /< imageName> / push?tag =< tadName>
请注意,您还需要 X-Registry-Auth
标题。
Note that you will also need the X-Registry-Auth
header.
这篇关于使用Docker API推送到私人注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文