[英]Using Docker API to push to private registry
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"
I can use the CLI to do this: 我可以使用CLI执行此操作:
docker push localhost:5000/oillio/my_app:1.0-SNAPSHOT
This works fine. 这很好。 But I can't figure out what the syntax is to do this from the API.
但是我无法从API中找出执行此操作的语法。 When I try the above, I get a status 500 response with the text "EOF"
当我尝试上述操作时,我收到状态500的响应,文字为“ EOF”
The tag needs to be as a parameter and not within the url: 标记必须作为参数而不是url内:
/images/<imageName>/push?tag=<tadName>
Note that you will also need the X-Registry-Auth
header. 请注意,您还将需要
X-Registry-Auth
标头。
a working example: 一个有效的例子:
curl -X POST -H "X-Registry-Auth:787f5fe5195c40ef924ac8d67948e15a" http://172.19.32.116:8833/images/172.19.32.116:5000/test7/push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.